bugfix: don't return dup testcases for instructor w/ >1 sections

Problem was joining on course registrations table, which
produced multiple matches for each registrations.
(Instructors who teach multiple sections have multiple course
registrations.)

Also, introduced a generic way to load a model object based
on its unique id.