Share code between caldav and carddav implementations