Avoid Ivy types by inlining MatcherHelper and using our classes.

+review REVIEW-5257
Avoid creating an extra instance of ModuleIdentifier.

+review REVIEW-5257
Convert ExcludeRule to Gradle types a bit earlier

+review REVIEW-5257