Initial refactoring of mistake-list SQL, for use in top, class, and quiz commenter views