Major refactoring of counters.

Changed the Statistics module to a set of type classes to implement
statistics counters.