add `compare` module with comparators

Take two. The heap code will follow later.
Using a second comparator here is overkill, I think, which is what motivates the introduction of `Extract` in the subsequent example.