removed references to window outside requirejs modules, which cause compilation problems with r.js