More MMCC utilities ported from pre-upgrade Moodle