MDL-40371 Upgrade-until-22: remove obsolete _upgrade_grades functions