Performance: Reduce calls to html5lib parsing in document()

This PR attempts to remove all html5lib parsing calls in the common critical path in the document view.

This includes TOC and summary generation, as well as quick link & zone nav extraction. So, a spot check should play around with each of these document features.