MDL-43420 JavaScript: Add JavaScript exception handling
MDL-43420 JavaScript: Add system to warn of deprecations properly
MDL-43420 Tests: Catch JS Exceptions in Behat tests

Look for any JavaScrpt exception being thrown, and pick these up in Behat,
failing tests.