Added startListening function to Connection API

In the previous version the server started handling incoming
messages immediately which meant that sometimes the connection
handler didn't have time to register callbacks before the first
message arrived.

This new version introduces a "startListening" function that the
connection handler must call after registering all callbacks.