Fix for negative Metric values
Creates objects from subqueries in some cases
Refactorization of MetricDatabase to reduce number of instances and to use CachingDatabase for caching and optional preloading
Bugfix in query generation when selecting count() and filtering by
a metric value
Optimizes CachingFilterPreload to only preload items which were
retrieved via id-only queries