requestAnimationFrame isn't fully supported unprefixed on all browsers. Implemented a polyfill