js: merge sort