Allow comparator to be a function

This is useful for sorting by the value of can.compute