Move the to_ics method into CalendarState

This allows us to make the code cleaner in the
presenter and controller.