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

You shouldn't pass the implicit here, it can be inferred giving an implicit encoder for vector and one for phase result (which the compiler will find in the companion object). Also, a good rule is to never capture implicits (i.e. never store them as fields, only pass them via implicit parameter lists), which is what happens when you use an implicit in a constructor.