Merge branch 'wip_MDL-40778_v2' of https://github.com/jamiepratt/moodle