added SpaceSaving, LossyCounting and Exact algorithms and standardized the interface