Added sorting for cohort members and removed deprecated key_exists() call.

See tickets #240 for sorting of cohort members and #367 for changing of key_exists() to array_key_exists().