fix: be very careful when replacing existing traces
minor: cleanup
fix: make more use of lexical binding
fix: yet another tree updating bug
fix: save and recover point more reliably