Record key suffixes by layer, not by depth.
Better recording and printing of tree stats json.