Rearchitect

This PR refactors to remove duplication.  It creates an abstract base class `IDirectedGraph`, from which the concrete classes `DirectedGraph` and `ObjectGraph` inherit.