Code to check for internet connectivity

Placed in code that will check for internet connectivity before doing
functions that require internet.