Functional group creation.

That proved trickier than expected.  But now the build_groups() method
does what it should, and only the validations and attribute weightings need
to be adjusted.