Generate cohort invitation code on creation. Issue #479.