MDL-41593 admin: use default setting if preventexecpath active

This resolves problems when installing Moodle
and addons when preventexecpath active.

Please note the admin_setting_configfile is still
incorrectly restricted - this will be resolved by
MDL-40949.
MDL-47704 Grades: Fix for set_usedinaggregation

Used in aggregation was not resetting previously set values
when recalculating an aggregation. This meant that items no longer
in the aggregation, were displayed with stale weights in the user report.
MDL-46133 tool_monitor: added event cleanup task
MDL-46133 tool_monitor: added unit tests
MDL-47664 phpunit: Do not use sequence number changes for Oracle

When resetting a sequence number, we call change_database_structure()
which in turns clears the MUC cache for databasemeta. This cache contains
information about the table, columns, etc.

After the cache is cleared, it must be re-filled, and it was discovered
that the get_columns() code which fills this cache can take a particularly
long time. Given that this is called for every table in Moodle, this can
add up to a significant period, and this is done on a per-testsuite basis.

On my SSD install this was taking approximately 40 seconds on each re-fill
of the cache.
MDL-38172 Lesson: Additional Info not displayed at end of lesson
MDL-47728 tool_monitor: added capability check before displaying link
MDL-47754 install: fix redirect loop
MDL-47739 form: Calendar widget causes unintentional focus and scroll
MDL-47503 Grades: Completely remove aggregationsubcats

This setting is not compatible with combinations of aggregation methods
and the ways in which it does and does not work are not documented. It
was voted to remove it completely by the gradebook workshop, so I have
completely removed it and added a warning for all affected courses + restored
backups.
MDL-47400 gradereport_history: Ensure float precision is enforced

Format floats according to the grade item config.
MDL-47503 Grades: Display the notice about upgraded grades on all grade report pages.

Moved this to the print_grade_page_head function and added an access check so it only
displays for teachers.
Merge branch 'wip_MDL-47754_m28_installredir' of git://github.com/skodak/moodle
Merge branch 'MDL-47503-master' of git://github.com/damyon/moodle
MDL-32616 question engine: move unit test to better name
MDL-32616 question engine: set_max_mark_in_attempts MySQL perf

The MySQL (& Maria DB) query 'optimizer' was failing to handle this
query, so for that DB only, we give it an equivalent query that it can
get right.

With unit test.
MDL-47588 behat: fix switching back to the main window in Chrome

This fix is mostly based on what Colin Chambers found out. This commit
is a simplification of his work.

The problem is that the Chrome / Selenium 2 integration cannot swich to
a window with a blank name. The work-around applied here is, when we
switch away from an unnamed window, we set a name on it. Then we can use
that name to switch back.
MDL-47588 question behat tests: don't close the preview window.

If you do. Chrome + Selenium2 gets stuck (on Windows at least). Selenium
must be trying to send commands ot a window that does not exist any
more.
MDL-47651 quiz responses: allow for qtypes without responses
MDL-47666 DB auth & enrol: unit tests fail with custom DB drivers

Changed to used $DB->get_db_family, rather than hard-coding the list of
class names.