Allow make-tree-map to take a comparator
Adapt tree-map for comparators