MDL-44720 modinfo: make it easier to use cm_info instead of get_coursemodule_from_id

by adding function cm_info::get_course_module_record()
Merge branch 'wip-MDL-44720-master' of git://github.com/marinaglancy/moodle
MDL-44720 modinfo: whitespace fix