add tests for new reStructuredText directives for document structure
move template rewriting to a separate rewrite step to avoid early access
to uninitialized structure data
add tests & fixes for standard toc directive