support nested dependency sorting.
Merge pull request #2 from stephenplusplus/re-sorting

support nested dependency sorting.