MDL-34182: Add functions to warn of output in AJAX scripts

We need to be able to capture output when including contributed code as it
may add additional content which makes makes the json we output invalid.

We only warn of these errors if the site is in debugdeveloper, otherwise
we silently drop them.
MDL-34182 Repositories: Check for and warn on invalid output in the file picker
MDL-35032 mod_book: 1.9 backup restore convertis files to book area
MDL-43188 core_message:reimplemented the beep on new message functionality from 1.9
MDL-43250 Assign: separate groups mode fix

When in separate groups mode, only get graders in a group that is in the course module grouping.
MDL-42212 mod_lesson: Fix callbacks retrieving activity files
MDL-42212 mod_lesson: Localise area names
MDL-43399 Badge: the Choose... option can still be selected once a role is choosen.
MDL-30195 portfolio_googledocs: Allow export of rich HTML
MDL-43423 behat: Running hooks before and after each step of a chained step
MDL-43438 mod_assignment: Prevent double inclusion of plugin files
MDL-41246 cache: Fix PHP notice of non well formed numeric values for the memcache store
MDL-41788 theme_bootstrapbase: Custom menus - sub-menus breaking.
MDL-43318 Assign: Fix bug when editing previous attempt feedback

Conflicts:

	mod/assign/renderable.php
MDL-43448 Links to the gradebook not fixed on restore.

Note we can only fix certain generic links, we can't handle ones like
/grade/report/{reportname}/index.php, but fortunately, we were only
using the generic ones.

I added a couple of other likely things too (badges and participants
list).
MDL-43367 stop returning of bogus context children when path unknown

This also prevents deletion of system context.
Merge branch 'MDL-34182-25' of git://github.com/andrewnicols/moodle into MOODLE_25_STABLE
Merge branch 'MDL-43318-25' of git://github.com/damyon/moodle into MOODLE_25_STABLE
Merge branch 'w52_MDL-43367_m25_contextpath' of https://github.com/skodak/moodle into MOODLE_25_STABLE
Merge branch 'MDL-30195-25' of git://github.com/FMCorz/moodle into MOODLE_25_STABLE