Refactor and improve script

This big commit heavily restructures rgdg and divides it into three
parts: option parsing, dependency graph traversal, and output
generation. This division makes it easier to explore the dependency tree
without producing undesired output.

Fixes #1.
Add README note about multiple edges

Saw this a few times during testing and figured out pretty quickly what
it was coming from. I don't consider this a bug.