Implement TopGradesGrouped sort order. Compiles fine, but untested.