Added counting/histogramming with tests.