More checks on generated .iml files (REVIEW-4493).
Don't generate IDEA dependencies without Java plugin applied.
Fix handling of IDEA minus configurations + tests.