Add connection connection disconnection methods

Targets #650.
Still missing:
 * [x] Locking