Added adapter
Allow multiple listeners to be inserted
Move the location of the callback.

This allows onDisconnect() to be used as a preparation of reconnection. This callback wasn't exposed outside the module yet, so this should have been safe.