Eager load site for filtered mappings
Eager load taggings => tags for mappings

* also rephrase the _tags partial so it uses the eager-loaded collection
  over tag_list, which doesn't participate in load caching
* this means that we don't query tags once per row in the index, instead
  just referring to things we pre-loaded in the filter
* Around 70-80% improvement in filtered mapping load speed
Switch Host#excluding_aka to an indexed column

* Was using unindexed with a LIKE
Optimise User#can_edit_site?

* It won't change within a request, so cache the result on first
  access.
Switch location of scope periods in filter
Cache the default host on first hit

* Avoids deeper SQL cache hit
Cache show_preview_links? result

* Avoids requerying @site.default_host.aka_host every row
  (would still hit SQL cache, but slower than cache)
* Also switch to shorter (no block) form of link_to
Eager load hosts for sites

* Get hosts data access out of the view
* Into a slightly-simplified SitesController with eager load for
  aka_hosts
Remove most_used_tags(_for_site)

* Get data access out of the helper
* Put it into Site#most_used_tags
* Optimise against our case rather than AATO's general case
  (AATO's case gives three subqueries, ours is simple JOINs)
Memoise User#can_edit_site? per-site

* Remove assumption that this is only used in context of web request
Codify our assumptions

* At present, one performance-related assumption that we're only
  tagging one type of thing
Merge pull request #301 from alphagov/eager-load-mapping-relations

Eager load mapping relations
Enable users to select unresolved as a mapping type

- Add a blurb about unresolved mappings and what the point of them is,
  when the option is selected. The copy on this probably needs a work,
  and in fact I'm not even sure it needs to be here. Thoughts?
- Mappings marked unresolved added through here get added, correctly, to
  the database with a type of unresolved.
Add a note explaining what an unresolved mapping is

- The note's copy has been discussed with @fofr.
- Add this as a partial, rendered only when the unresolved dropdown is
  selected, thanks to some JavaScript, and include it in two places.
Don't offer "unresolved" as a filter option

- There's a separate story in the backlog to filter by unresolved.
Show unresolved as archives in the mappings table, in muted style

- Add a question mark with a hover to explain the unresolved type, but
  why it is marked as an archive and greyed out.
- Based on @fofr's prototype.