MergeSort implementation in Scala.