Optimize DFS a bit

This change only modifies xdfsWith, which affects all of the depth
first searches.  It now marks visited nodes instead of using the
matching approach from fgl.  The depth first forest family of
functions is unchanged, but those are less of a bottleneck (in my
code).  It should be possible to apply the same optimization to them.
Compatibility with hashable-1.2

This change is backwards-compatible with older hashable versions.