finishing changes to models to support groups and tests related. Fixes #328