Added missing functions, and initial support for uncaughEvents

I've added the missing functions based on code from Node.js domains and improved the currently ones, though I'm having problems with the testing of the window.onerror event since I've not be able to make it work its Node.js counterpart, the process uncaughtEvent. If someone could be able to review it and make it work, we could be able to have fully working domains on the browser easily (I think it's mostly the only missing part...).

Also, I think this should follow better the Node.js scheme by using an explicit Domain class instead of just an EventEmitter, this could help to share code and maybe also look for what are the missing things from process so it could be used directly the Node.js domains module.