Add device health check before polling for work

Added a health check to make sure the device is online and optionally has an IP address assigned and is within a target temperature before polling for work.  Also fixed the API key support and added support for specifying a friendly device name for reporting (falls back to device serial number).

New command-line options:

--maxtemp <temp> // Maximum allowed battery temp - i.e. --maxtemp 36.8
--checknet yes  // Check for a valid assigned IP address before polling for work
--name <friendly name>  // Use the specified friendly device name for reporting instead of the device ID