proper iterator implementation
tree iteration unit tests
minor fixes