Memoized ModList.merge, and implemented merge sort.