Performance optimisations (more to follow)

- Refactored the way Datamappify walks attributes to allow query optimisations.
- Optimised ActiveRecord queries for entities.