Adding test coverage for contributor statistic handler, and some refactoring.

This will increase test coverage enough to pass, but I don't think that the right number of commits is being reported. I don't have time to look into it today, though.