Bugfixes for the timeperiod feature.
More bugfixes for timeperiods.
Implement complex 1.x timeperiod definitions.