Fixed some hidden bugs in graph.js and added support for graphviz output