cleanup sorting to (almost) get rid of the old SORT_METHOD_FOO

This is some long overdue work to clean up the parallel usage of the old SORT_METHOD_FOO enums and the new SortBy enums (introduced by me during my GSoC work last year). We can't get rid of SORT_METHOD_FOO completely because it's exposed to python plugins so it still appears in CPluginDirectory and the python bindings but it should be gone from everywhere else.