Iva's implementation of Tarjan's algorithm, poor-man's changes to graph factory.