Fix/tests

* Add tests for ConnectionHandler.
* Make ConnectionHandler event handlers return promise results.