Checks a list of packages and their depenencies and returns the order they should be installed in.