adds event emitter interface to connection
fixes some bugs with connection events
and got all tests passing
adds docs for event emitter interface
Merge branch 'next' into 846_event_emitter