add `compare` module with comparators

Take two. The heap code will follow later.
I think this is a confusing name, because `cmp` means something else in rust stdlib. Unfortunately, I don't have a better replacement in mind. Maybe `comparator`?