Add rolling histogram and factor out anomaly detection

Ok, having read the function now: Passing in a comparator function seems unnecessarily complicated. Do you have plans to use a comparator other than "greater than" at some point?