animation loop + EventEmitter for browser, node.js and AMD. Uses requestAnimationFrame with fallback to setTimeout