Add test for size recording correctness

Also implement behavior of updating entire subtree when a
folder is being moved to a different root.