XD-908: Query aggregate count by number of points

Adds an extra query method to the AggregateCounterRepository which takes
a date and the number of points prior to it which are required. If no
date is supplied, it will return the previous n points from the current
time.