Refactored HistogramManager

Moved most functionality to Histogram, and the filter functions, which
have general application, to utils.py.