Added graph sort to conda dependency resolution

This adds a graph sort to the conda dependency resolution. The packages are now fetched and linked in the order of their dependency tree.

This is the first step in issue #997