Get rid of re-implementation of sortBy

I have no idea what this was doing lying around here, and due to the
usage of tuples it's actually slower, too.