Allow tree legend component rendering to be deferred

Broken out code from #218. Still need some work:

* Remove node.el reference when appropriate
* Tests