MDL-40368 tool_capability: overall improvements made

* Can now compare multiple capabilities at the same time.
* Capability search now persists between requests.
* Upgraded to use renderers.
* Upgraded module.js to YUI shifted module.
* Converted deprecated calls.
* Converted forms to Moodleforms.
* Implemented backend functionality to overview at
  different context levels. Not possible presently as
  there are no front end hooks.
MDL-39020 phpunit: Rename incorrect filename

Rename externallib_tests.php to externallib_test.php
Fix failing unit tests
MDL-40358 Administration: Added group and status filter on user enrolment page
MDL-40386: Fix for updating timemodified field in book_chapters
MDL-40368 tool_capability: clean up as per notes from peer-review.

* Coding style clean up.
* SQL indentation
* Removal of non-matching capabilities when searching.
* Fixed notices/warnings when hitting enter on search.
MDL-40434 calculatedmulti multiple-response questions not randomised
MDL-37065 - Change get_string('status') token in assignment submissions page to a different token (for translation flexibility)

AMOS BEGIN
 CPY [status,core],[status,mod_assign]
AMOS END
MDL-38314 repository: Remove orphan repository instances
MDL-38314 repository: Delete repository instances on context deletion
MDL-38314 repository: Unit Tests for delete_all_for_context()
MDL-40472: Clean all codechecker warnings on mod_assign
MDL-38314 repository: Improving performance of upgrade script
MDL-40369 theme: Fix core using deprecated icons
MDL-40369 theme: Remove deprecated icons
MDL-40369 theme: Afterburner does not override deprecated icons
MDL-40369 theme: MyMobile does not override deprecated icons
MDL-40369 theme: Removing old gif icons with PNG/SVG versions
MDL-40400 Gradebook: get_toggles_html and print_toggle cannot be used anymore
MDL-40490 - database: Fixed a check on database port options.

The addition of a port for the database means that an array
would be set regardless of whether it had any information or not.
The isset() function sees an array as being set and follows through
with the rest of the if statement concatenating a colon to the end
of the database host name and throwing a connection problem if no port
number is supplied.

The if statement has now been changed to if not empty. The empty
function does see zero as an empty value, but a port shouldn't have
a value of zero anyway.
MDL-40401 Libraries: load_temp_role() and remove_temp_roles() can not be used any more.