Fixes and improvements to lottery script

Fixes lottery code for using multiple priorities and StudentSubjectInterest, and adds an option to fill out lower priorities for students based on their interesteds.

If someone wants to take a look at this before 5pm tomorrow, that would be great; if not I'll just merge and we can take a look when the whole project gets merged.