Added merge sort functionality and test