javascript merge sort