Tree: various speedups (#887)
* Tree: various speedups - make dataclass non-frozen - use mutate() for cases where a Map is modified multiple times - remove asserts for cases that would fail immediately anyway * make frozen depend on __debug__, restore an assert * Improve depth() Co-authored-by: Alexandru Fikl <alexfikl@gmail.com> * opt ancestors --------- Co-authored-by: Alexandru Fikl <alexfikl@gmail.com>