Using ConnectivityManager to check for network before connecting

Registering for network change broadcasts to trigger reconnects.

Fixes #86