Flexible implementations of useful sorting algorithms.