Added more functionality to ddocopt.d, TODO, add tree classes