Group assoc conditions

@nicknill's work in a PR, with updated tests. Fixes #361