Use dagre v0.3.0

The new version of dagre takes a dagre.Digraph as input, instead of
node and edge maps. In this case, the resulting plugin is about 30 lines
shorter and the logic is simpler.