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.
Merge pull request #37 from daveho/master

fix for issue #36 - dup testcases in edit problem page