[WIP] Surjections

Memoizing surjective functions.

- [ ] It’d be nice if linear search/binary search/hash table lookup were somehow configurable.
Todo: document these.