Fix roles on user registration.

We were storing the role in the database incorrectly and not correctly
creating the :roles set in the authentications.
Merge pull request #450 from MastodonC/feature/fix-user-registration

Fix roles on user registration.
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
Add paging to search results.
Use page and size in ES queries.