More dynamic trees, with multiple layouts.

Also lots of cleanup of old code from before we had proper models.