Fix window object not being detected in runtime.

For some reason 'var window = window || {}' fails to detect the window object in some browsers, and therefore requestAnimationFrame was not being used even if the browser supports it.