Allow tree legend component rendering to be deferred

Also adds a reference to el on node which can be used to render the component later.

Main purpose of this is to be able to initially hide legend and only loading them on demand.