Added initial tree structure and functions. LOTS of new stuff