Working update_tree
Firest refactor of update tree and refactored tests
WIP