Fixes and events

* Adds an event `ready` when all connections have been established.
* Fixes a few issues with the error-handler tests.
* Removes dependency on lodash and uses native functions for `map` and `reduce` instead.