Improved requestAnimationFrame polyfill; fixed timer leaks; added tests