Upgrade to Rails 4.1.4

1 feature and 5 specs fail, plus a couple of warnings about minitest.
Fix minitest warnings by upgrading shoulda-matchers

We were getting these warnings when running any tests:

    Warning: you should require 'minitest/autorun' instead.
    Warning: or add 'gem "minitest"' before 'require "minitest/autorun"'

...and:

    MiniTest::Unit::TestCase is now Minitest::Test.

Upgrading shoulda-matchers removes these warnings - they were fixed in:

    https://github.com/thoughtbot/shoulda-matchers/commit/cd9594603eb9485deb63f3ce107e4ebf490efbf5
    https://github.com/thoughtbot/shoulda-matchers/pull/466
Fix test setup failures by separating use of factories

The 5 specs using this setup were failing with this error:

ActiveRecord::StatementInvalid:
  Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')
    GROUP  BY hits.host_id,
              hits.path_hash' at line 4:           INSERT IGNORE INTO host_paths(host_id, path_hash, path)
    SELECT hits.host_id, hits.path_hash, path
    FROM   hits
    WHERE host_id  IN ()
    GROUP  BY hits.host_id,
              hits.path_hash

Separating the lets out and assigning the host to the site seems to
fix this. I assume that something related to transactions has changed
in the upgrade to Rails 4.1.0 but I can't see what's responsible for it.
Stop ActiveRecord generating nonsense SQL with .count

A bare count on a query which selects specific fields instead of * is turned into
invalid SQL by ActiveRecord. This is newly documented:

   https://github.com/rails/rails/commit/3023363fff502487740bd0b83a3069320551ec96

When we're selecting only some fields, .count generates COUNT(field1, field2)
which is invalid SQL. The recommended solution for this is to use .count(:all)
explicitly. In this case the rest of the partial uses .length, so I'm using
that instead here for consistency.

This fixes the last feature failure.
Prevent an unnecessary COUNT query by using .to_a
Remove a duplicate `hits.host_id` in custom select

This wasn't breaking anything.
Merge pull request #372 from alphagov/rails_4-1-4

Upgrade to Rails 4.1.4