Refactor change detection

WIP
add a test that does `parent.addChild(child1); child1.addChild(child2)` as that was the buggy case before.