new addConstraint syntax for specifying groups of constraints

Squashed and will merge tomorrow if there aren't any objections.