Rewrote dfs to use continuations.

The dfs code no longer blows the stack. It's pretty messy at the moment
(that function is ugly!) but it works properly. I'll probably go back and
rewrite it, since, yeech.