Import Dependency Tree Script

It is currently in a working state, but has some hacks and needs some
overall improvement.