Hg 113 support for subpages

Refactor code to work with subpages
and some better support for comments (but this still needs some love)