total-sorta

Abstracted helper functions, based on total order. Inspired by Sedgewick.