Add tests and fix for issue where Ivy dependencies do not have sources attached correctly.

See http://forums.gradle.org/gradle/topics/idea_gradle_plugin_generates_wrong_sources_jar_for_multi_artifact_dependencies