fix bug 982942: Ensure section IDs injected for ?raw; performance tweaks

* Ensure that section IDs are injected into content fetched via
  ?raw, which also fixes section extraction for ?raw&section=foo

* Further reduce the instances where wiki.content.parse() is called
  during the view critical path, limiting it to just the few remaining
  cases in _filter_doc_html()

* Left some TODO comments as notes for some next steps in view
  optimization
Merge pull request #2147 from lmorchard/982942-inject-section-ids-for-raw

fix bug 982942: Ensure section IDs injected for ?raw; performance tweaks