A fairly straightforward port of the Python calendar.Calendar class.