CMS-4696 Improve NumberRangeAggregation

Added new parameters. Also refactored some aggregation-related classes.