XD-350: Hourly resolution aggregate count queries.

Also handler and module definition for counter.
XD-352: In-memory aggregate counter implementation.

Refactor of aggregate counter tests to share them between implementations.