create workgroup cohort if it does not exist when adding a user to a cohort

some slight refactoring and adding test coverage regarding adding workgroup users to cohorts

use exists(), it's faster and cleaner