Moved treeviewer functionality to UI.js