A polyfill and wrapper for requestAnimationFrame, providing common functionality for animation and timing loops