Moved code around. Moved unused code to the bottom of the file
Started working on code to merge the top-level nodes of various processes into one
Small updates to merging code, before moving and final placement
Work in progress
More fixes to the top-tree parts and memory leaks/cleanups