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

Sounds good. I'll apply the same logic and write `EncodeJson[RenderedTree]` in the `RenderedTree` companion.