Scope _ and Backbone variables using the 'var' keyword

Scope _ and Backbone variables using the 'var' keyword. If exports is undefined, then get them from the 'window' object explicitly.

While not absolutely necessary, this fixes a couple of warnings in PyCharm.