Group project-related stats into a class.

Reduce number of instance variables available to the views.
Replace raw SQL with AR-type query.
Group context-related pieces in a class
Encapsulate counts and totals into a class.

Move queries out of the view and into the model layer.
Inline helper method
Inline last pieces into StatsController#index

We can now skip the before filter that sets instance variables.
Encapsulate dependencies of stats index page

This may be a bit extreme.

It's modeled after the ideal "rails way".

In the controller, we now know the name of a single resource. It
doesn't happen to be backed by a database table, but it does know all
about the task of collecting stats, leaving the controller concerned
with just munging params and rendering stuff.

I called the resource `IndexPage`, to avoid the temptation of trying to
reuse it, which can get pretty messy.

Later, if a better abstraction appears, it should be fairly painless to
alter.
Merge pull request #169 from kytrinyx/index-page

Encapsulate dependencies of stats index page