Simplify substitutions, better debug printing.
Traces record both incoming and outgoing substitutions. This makes recursive traces much clearer.
Trace the stack of goals explicitly as pushes or pops.
Create explicit stack from trace frames.