Better connection handling

Periodically send ping messages to the server to detect the twitch
server has died.
Automatically attempt to reconnect when we detect the server is not
responding.
Detect when the computer is actually disconnected from the internet and
do not attempt to reconnect until internet access is restored.