Refactored the way dates are handled throughout, removed dead code in calendar-test