Add programme_id and public_access to search.

- Use elasticsearch filters
- Update elasticsearch when we post, put and delete devices, entities
  and profiles
- Replace :id with :<resource>_id in the API