Guard out antique browsers

Comment out more code that existed solely for IE10 and older. This
removes the final jshint warnings from this file.
Fix undefined variables

Fixed various typos in references to variables.

Also throw an exception if a variable is not found in GPRINT for
debugging purposes and move some variable declarations.
Fix invalid function call

During conversion from PHP, this function was apparently missed.