Optimize page_tree.js

Still I got an error with adding subpages