changes in period function

period function is now acting as a Factory.
Period class have been splited into 2 classes: FixedTimePeriod and
DateRangePeriod. Get off over specialization.