Added ring buffer for last headings.

Added a ring buffer and methods for creating DOT files for graphviz for visualization of the graph.