Rename doSort to sort and sortBy; use positional args in sort; use partition rather than filter+filterNot; add MergeSort