Modifications to TreeTool; extended JS API