Connection fixies

Moved keepalive to client thread
Added options to select reconnection interval and count
Minor changes on local account remove