new argsort that accepts different serial argsort and merge
routines.