Performance: Generate TOC HTML only with new revisions or re-rendering

Baby steps toward improving html5lib parser usage, here. Just removes a redundant parser call and moves TOC HTML generation out of the critical `document()` path. Seems to carve a few 100ms off the CSS pages I'm testing.

For spot checks, try editing a document a few times, add sections, remove sections, ensure that the TOC stays in synch.