Cleaning globals

Removes the use of globals where possible (`window jQuery:` changed to `asJQuery`, abstracts `alert:` etc to UI using elements and more).

Result: no `jQuery` global used beyond `Canvas` package, only three direct uses of `window` left in the codebase beyond abstracting `BrowserEnvironment` class (which is itself in `Canvas` package).