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.