Moved rendering logic to HtmlCalendar + some tests