Fix gen_cert_report to use CourseKeys.

Use CourseKeys and clean up some outdated code.

@flowerhack @sarina @cpennington ?