Optimised CompositeConstraint->check() logic.

When using MODE_ANY, the method will now return true as soon as a constraint returns true rather than checking all constraints unnecessarily.