Trying to unify program and plan selection code.

This also includes a potential fix for horrible problems with students who change plan or program over years: if a year ID is specified, this will only select
students with (or without) the specified plan or program in that year. Without a year, a student iwll be selected if they have *ever* been on a given plan or
program.