General algorithm
I set the merge target as index-to-callables
so that the diff is useful. Once !106 (merged) is merged, this should go to main. For the same reason this shouldn't be merged before !106 (merged).
Closes #150 (closed). I tried my best to keep the commits atomic, so see the commit messages for the list of specific changes.
Edited by Anton Akhmerov