Capture result from each (major) phase as trees in API

Since this type has become more specific, it should probably be renamed to something like, `PhaseError`, and `log` renamed to `completed` or something.