Misc cleanups.
Added initial version of treebuild.
Very crudy and buggy. This is WIP.
Work in progress.
Better file handling.