add `compare` module with comparators

Take two. The heap code will follow later.
Curious if you have a usecase in mind.