Refactored SensorBase to incorporate aggregations and calendar based queries.