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-43318 Assign: Fix bug when editing previous attempt feedback

Conflicts:

	mod/assign/renderable.php
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