Add rolling histogram and factor out anomaly detection

`golint`:

    counter.go:42:9: should omit 2nd value from range; this loop is equivalent to `for i := range ...`