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

Problem was joining on course registrations table, which
produced multiple matches for each registration.
(Instructors who teach multiple sections have multiple course
registrations.)

Also, introduced a generic way to load a model object based
on its unique id.