Add a global error trapper for the browser

JavaScript errors are invisible unless you've got developer tools open,
which is making it hard for users to report errors. This change makes
JavaScript errors popup a big red alert