Add test helper for sorting test benchmarks.
Change quick sort to choose median pivot rather than random.