Added test code. Updated some taces. Resolved issue where the aggreagation deamon missed to aggregate the latest complete period.