Client-side compatible port of Node's event.js.