factor out setting of root so that external tools can reset the tree to get new display. Also allow setting of ruleNames list externally.