Change Tree to yieldable and fix tests