Fix editing of devices

- Store location as stringified json
- Add schema check to devices.
- Add tests and fix privacy checkbox.
Formatting as per @otfrom's comment.
Merge pull request #451 from MastodonC/feature/devices-bug-fix

Fix editing of devices