Use classes to mark contents, added TOC

We now use a class to mark where the markdown html should be inserted.
Generate a simple unordered list table of contents from headers, and
add it to another location labelled with a class. Use text() in headers
for header names, rather than innerHTML.