LUCENE-2333: Fix failures during contrib builds, when classes in core were changed without ant clean. This fix also optimizes the dependency management between contribs by a new ANT macro