Fixing IE bug where map does not load

Fixes an issue where IE versions > 8 would fire a callback twice on .onreadystatechange(). IE8 still uses this handler, but for IE 9 and above, plus all other browsers, we have implemented jQuery's .load(). 

Also added variable declarations to global variables, to avoid errors in IE8.