Implementation and test of merge sort