Better error handling for checking location of devices

We weren't checking to see if the device actually has a
location_finished attribute before accessing it. If a macbook
that was turned off was checking this way, we would fail higher up
then we needed to.

Also, import json the normal way, and clean up the repr on device.