Added support for calendars and events, and cleaned up call to get namespaces.