now using the rewinder to recreate past states. 
replacing a child is now handled correctly.
made State a class.