Jko/record events

The rationale for using `setImmediate` is described here: http://blog.ometer.com/2011/07/24/callbacks-synchronous-and-asynchronous/

I re-wrote using `nextTick` to make this clearer.