ENH partial sorting for mi in sortlevel

fixes #3984.

Still need to tweak the docstrings and stuff. But I think this is working.

cc @jtratner