Academy Moodle patches M#13 and M#14 removed. Also merged existing code from upstream MOODLE_25_STABLE into rendered.php