Refactor the Stats function to be a bit faster.

Previously, the performance was roughly as follows:

$ go test --bench=.
PASS
BenchmarkStats   1000000              2324 ns/op
ok      counter 2.367s

With these changes:

$ go test --bench=.
PASS
BenchmarkStats   1000000              1817 ns/op
ok      counter 1.855s