Added compatibility fixes

Fixed requestAnimFrame shim, changed event listener to support older jquery versions.