Add animation frame polyfill to support old browsers