Added work-in-progress function to generate iCalendar strings, and re-added some debugging