Polyfill for requestAnimationFrame/cancelAnimationFrame