Mergesort in javascript.