JavaScript animation timing made easy (requestAnimationFrame, cancelRequestAnimationFrame)