Make sure `global` refers to `window` in browser context.

Fixes bug where setInterval() was being used in place of
requestAnimationFrame().