Use main renderer for includes, fixes #15

This is the same as the include plugin does and should fix various
problems like duplicate ids when the same header is used more than once
etc. Also the table of contents now includes all pages from the blog.
Add more type information and define variables earlier