Refactor to use requestAnimationFrame and time-based animation.
Add requestAnimationFrame polyfill.