Simple Javascript timing engine driven by requestAnimationFrame