Basically an improved port of the makeshift depgraph from the pygos build system. Signed-off-by: David Oberhollenzer <goliath@infraroot.at>