Re-doing this whole thing...
Re-added dfs.

This version supports special handling for entering and exiting nodes
during search. This should enable efficient implementation of
algorithms for computing strongly connected components and topological
sorting without needing to change the dfs code.

Still to do is to add functions which handle traversing edges.