MDL-41792 calendar: refactored the calendar to allow the use of multiple calendar types