Vastly improved sorting performance

It pays to take a closer look at the methods.
Also: more coffee.