Markdown in heading cells (take 2)

small typo prevented the previous implementation from working.

This also moves the rendering to the 'render' method,
away from set_rendered.

closes #3053

(again)
truncate invalid multi-line headers
merge heading lines

markdown headings must be a single line
remove unnecessary heading-anchor

residue from when the heading text itself was a link

the id is on the header tag itself,
and the link is anchor-link
allow extra pandoc args
use mathjax-style for math passing through pandoc to html
add html_text and add_anchor filters

- html_text is like $(element).text
- add_anchor add the anchor url and link for heading cells
enforce  single-line heading cells in templates
use plain markdown for headings in base latex

addresses the fact that many generic markdown operations are not allowed within settings, and pandoc will handle these.

Sphinx still has its overrides because it needs to change the level mapping.
add some missing parentheses
use markdown for rst headings

underlines and all, no need to measure length.
command.extend in pandoc
Merge pull request #3601 from minrk/headingmath2

Markdown in heading cells (take 2)

closes #3053
closes #3597