Drop inheritance; Embrace the duck

* Adds substitution tests for fruit
* Bug fix for IsFlat for flat trees