make sure we drop the legacy metrics_index table during schema update

The metrics_index table wasn't getting dropped for new installs. Fixing this
created a problem in TopologyManager where it sets gc_grace_seconds for each of
the tables. This commit modifies the logic in TopologyManager as well so that
it no longer tries to update gc_grace_seconds for metrics_index and so that it
does set it for metrics_cache and metrics_cache_index.
[BZ 1104916] add logic for reducing cluster size from > 4 nodes

The case for the previous cluster size > 4 was missing which resulted in an
IllegalStateException, which in turns causes the undeploy process to fail.
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.
[BZ 1069648] Update JAVA_OPTS from connection settings for Standalone servers.
[BZ 1069648] The JAVA_OPTS are now added to the bottom of the file and is additive to existing settings. This is a safer approach.
[BZ 1069648] First level name refactoring due to logic changes.
[BZ 1069648] Additional name refactoring.
[BZ 1069648] Short class names and also update the logic in a few places.
[BZ 1069648] Small spelling fix.
[BZ 1069648] Short text to be under 1000 max character limit.
[BZ 1069648] Distinguish the JAVA_OPTS variable by adding the RHQ suffix.
[BZ 1069648] Few more updates from pull request review.
Merge pull request #42 from rhq-project/BZ1069648

[BZ 1069648] Persist JAVA_OPTS from connection settings for Standalone se...
fix logic for determining the most recently stored raw data
[BZ 1105032] make sure we set gc_grace_seconds on the right tables
[BZ 1051299] Check for illegal arguments passed to the helper methods and throw an adequate exception to present more info to the user.
Renaming img/logo.{png|svg} to img/logo-login.{png|svg} because of name conflict with logo for top menu bar.