Avoid following cyclic dependencies and make sure there are no duplicates in the resulting list of dependencies.
Merge pull request #7 from romanb/dependency

Avoid SO with cyclic dependencies