refactored out comparison function typedef
made arguments constant to comparison function
updated documentation
added self object to mergesort
simplified documentation
added WARN_UNUSED attribute to warn for unused results
optimized mergesort