refactoring.
refactoring according to #282.
Adding connection counter.
adding a new API: setInstallShutdownHandler.
comments.