use the mongoid criteria length to cache the count of the collection per criteria

Fixes slow pagination into large mongoid collections as the criteria method didn't cache the count. ActionViewExtension#page_entries_info calls total_count 3 or 4 times (depending on execution path), slowing the view render.

http://mongoid.org/en/mongoid/docs/querying.html

Criteria#length, Also size. Get a count of persisted documents. After being called once for the criteria, will cache subsequent calls and not hit the database.
Merge pull request #484 from camallen/count_fix

use the mongoid criteria #length method to cache the count of the collection per criteria