Removed unused variables and made sure dependencies were defined
Added polyfil for requestAnimationFrame