add `compare` module with comparators

Take two. The heap code will follow later.
It's times like this that make me wish for default arguments. :(