User:Jackmcbarn/Parsoid subst

Here's my proposal for how subst: should work in Parsoid (and VisualEditor):
 * 1) A user in VisualEditor wants a template substed into a page.
 * 2) They add it to the page as normal.
 * 3) They click a "subst now" button on it, either in a context menu or in the page where arguments are entered. Where the button is isn't important, but it's important that it's a button, and not, say, a checkbox.
 * 4) Behind the scenes, VisualEditor sticks subst: in front of the template's name.
 * 5) VisualEditor sends the page back to Parsoid and asks it to do a PST.
 * 6) Parsoid takes all of the templates that start with subst: and substitutes them. (In this case, it would just be one, but we support more in case other consumers want to.)
 * 7) Parsoid sends the page with the substituted template back to VisualEditor
 * 8) VisualEditor uses the new content, and the template is now fully substituted.

If the user wants to delay the substitution until they save, they can do that by just putting "subst:" in front of the name manually, but then their preview is inaccurate. I'm not sure the best way to handle this.