add `compare` module with comparators

Take two. The heap code will follow later.
Ah good point. I somehow missed the `cmp`. Mornings, eh?

It looks fine as-is then.