Most basic jshint

I can't believe that I've written such strange code within the last
year.  Some of it is just plain bad.

This update gets the js to simply pass jshint with only eqeqeq enforced.
It also changes function declaration patterns
from
var foo = function()
into
function foo()

I had that issue in soooooo many places.
And I've been working to try and move vars to their positions, top of
scope.

I'm going to need to draw some of this out in a notebook again, and see
what I'll save and what I'll scrap.

NOTE: canvas save function requires image source and canvas origin to be
in the same domain, and the filesystem is considered different than the
website itself.  SO, you'll need to run uiir as a site, not with a
simple double click, if you intend for the map to work.