add `compare` module with comparators

Take two. The heap code will follow later.
You need a reference to the comparator, so I don't think your example macro would work. We can rename the methods to something shorter, but three operands are always going to be involved (comparator and two values).