Add support for asynchronous event firing

To be in line with what JavaScript does when, say, a user clicks on an element listening to `onclick`, I added the `emitEventAsync` function, which treats the listeners as a whole (ininterruptible) block, but fires this block asynchronously.

This way, a user can asynchronously fire an event and then wait for the listeners to be executed before calling the callback parameter.