Improvements and optimisation

Now implement window.requestAnimationFrame much faster and browser
friendly