Refactoring calendar grid some more. Fixes #215.