make ConstraintSet a typedef, tweak applyConstraints definitions