TGF support for graph plugin

Adds support for the trivial graph format (TGF), which is useful for importing graphs into yEd (or other tools) for better layouting and interactive dependency graph browsing.

Also a few minor code cleanups along the way.