Feature/tree compose

As we continue to experiment with various approaches, we should try to structure it so that the logic is more cleanly broken and out independently testable.