Add device management tab

- Tidy up sensors model.
- Fix delete and user editable keys.
- Use inserts in devices PUT since it works like update.
- Add new sensors and new devices and edit them.
- Make alert a component.
- Show alerts on successful events.
- Add number of sensors per device.
Fix alert component and make fetching fns variadic.
Fix sensor schema and reorder fetching fns.
Merge pull request #146 from MastodonC/feature/new-device-sensor-ui

Add device management tab
Make it so.
Decode entities properly.

Devices are stored in a mix of edn and json atm, which is wrong and
should be fixed. We should create a one off job for this.
@sw1nn is his wisdom says "Prefer laziness."

And he is right.
profiles data cleanup.
entities data clean up
Filters and search fields
Load all entities into elasticsearch.

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html
Full entity in elasticsearch.
Elasticsearch component.
Fix typos.
Add programme_id as a searchable thing.
Refresh es function.
Make it so.
New entities index API.
Tidy.