MDL-29594 enrol: implement cache for course enrolment instances