Better reconnection logic. #12

We were resetting retries too early.
Plugin still can't tell if it's connected, need pings or heartbeats and
setimeout.
Removed commented out code.
Call shut down when giving up reconnect to clean up the UI.