Notes on sorting, including sorting lists of tuples.