Different style of managing the global object and its main components

Instead of having to initialize every component so it can get the
objects it needs from the global object, just have every component
point to the global object's new 'm' object, which contains references
to all of the components in the app. Worth a try.
Still experimenting with global object access
This global access method seems ok

Let everyone access $GalleryViewer as they like, but they all use a
local private 'm' to reference it, to save the ugliness of typing
$GalleryViewer every time.
Adjust background on window resize