JSHint tidying

This is a big, invasive change so we'll probably want to discuss before
merging.

Major changes:
* Trailing whitespace eradication
* Removal of most unused variables (see comments)
* Fix missing curly braces
* Add specific global declarations in the few places where browser
  globals (e.g. ActiveXObject) are assumed

TODO:
* Tackling scoping on functions which are assumed to be in the
  OpenSeadragon namespace but only used in files which other than the
  ones containing the declaration. These should probably either be
  merged or explicitly declared on the OpenSeadragon global
* drawer.js has some apparently unreachable code which should be
  reviewed
* viewer.js uses arguments.callee – we should see if there's a better
  way to structure this