* Moved keepalive functionality into connection

* Tested keepalive functionailty