refactoring cache index querying and making raw data age limit configurable

I have introduced paging when querying the index for the current time slice.
The query is against a single partition which can get large and cause read
timeouts. Paging should help guard against that.

I have also made the age limit for raw data that is ingested configurable.
This means for example, that the user can decide whether or not the server
should accept or reject measurement reports with data that is already 5 days
old.
[BZ 1104888] fix bucket aggregation code for calculating max
[BZ 1092756] fix calculation of aggregate metrics

The max value for aggregate metrics could get computed incorrectly as a result
of an if else statement that should have been an if statement. The error
manifests itself only for 6 and 24 hour data. It would occur only when the min
and the max fall on the same data point.
[BZ 1069545] Clip bad last character.
Update custom plugin sample following latest changes in
rhq-agent-plugin-plugin

See Upload mojo: RHQ4.12 allows to wait for plugin scan and plugins
update on all agents
https://github.com/rhq-project/rhq-agent-plugin-plugin/issues/16