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

Also Seq already has a codec so you will be able to serialize this directly once you have a codec for `PhaseResult`.