Gradle no longer keeps resolved dependency graph in memory (new model). Instead, we provide a hook so that users can get notified with the resolution result, when the configuration is resolved.

1. This is one of the steps to get rid of the old dependency graph model. Before we can get rid of the old model, we need to un-incubate the new model and make any necessary changes to the API before it is locked down.
2. The new resolved dependency graph model was also consuming enough heap in very large builds that it popped up in the profiler as one of the highest dominators.
3. When the withResolutionResult hook is not used, the resolution result is not even built during resolution.
4. Sorry for the large commit. At least it's easy to revert :)

Please review and give feedback. I wasn't sure if this is the way to go but it made sense to me & Daz. The public API changes require review.