Apply '{{#if expanded}}' to more trees and fix counts

* sub-tree counts were being applied to widget titles -- now the event
  is suppressed correctly
* now using {{#if expanded}} to prevent loading of external resources
  from within tree items