Add `cohort()` tests

Tests check that cohort() throws errors with undefineed test names, that it
segments users into cohorts and that it returns the cohort/variation name.
Add cohort implementation according to test spec