Work with staff and instructor group names as lists

This means that we don't need to make queries to find out whether the
legacy groups names exist.