Fix cur_grade to be relative to the relevant program's start date

This should fix #1216. Also includes some other cleanup around grade and schoolyear logic.
Ah, yeah, the other one does too. (It looks like this was an existing problem with getGrade.)