Ruby implementation of computer science merge sort algorithm