Completed mergesort algorithm and added accompanying tests. 
Improved error handling of mergesort algorithm and updated tests