Update Code.gs

Better error checking, add support for multiple calendars, slightly improved formatting