Refactored query_by_date() into a function decorator, applicable to aggregator views
Simplified get_dataset_by_dates(),

by inlining query function, as it is not used in the views anymore