Made topological sort for transactions support weighted edges
This improves the order of the transaction list significantly when a large number of packages are being installed at once, since it will use as many runtime dependencies as possible rather than falling back to just build dependencies when there are circular runtime dependencies.