Refactored Mergesort so that we do not expose the wrong interface.
Added a test for the same.