Fix Tree.__repr__ and refactor and add tests and

3 jobs for bugfix/tox-poetry in 46 seconds (queued for 3 seconds)