Simplify generating the rebuild order using a single DFS
Instead of iterating over pkgnames and creating two DFS's, create a single DFS by adding all pkgnames to the public 'stack' field.
https://github.com/petgraph/petgraph/issues/230#issuecomment-438748717