reporting: added algorithm for handling ambiguous level nodes, major refactor of report tree