An external merge sort implementation.