Fix treemap department grouping

Also add more robust tests to withstand irrelevant node/leaf class changes