More tests, and ability to sort data if a total ordering is given