Making the engine use requestAnimationFrame instead of a timer