xap97 to use the old toc until pages are assigned weight and parent page
Move TOC creation logic into a single js file