Improving reconnect mechanism

Instead of relying on the disconnect event, we now explicitly monitor
activity and force a reconnect
Improving logging and removing dead code