Restrict usage of dangerous templates to users with a special right.

Proper, out-of-the-box security, at last.
Allow free editing around restricted templates.

We only really need to protect the parameters and the number of restricted templates.
Add a base class for templates rendered by this extension.

Reducing duplication where we can. I'm a bit reluctant to get rid of the MagicWordwgVariableIDs hook, though - enumerating subclasses of a class in PHP requires getting a list of *all classes declared so far* and then checking the relationship of each of them.

As a result, I don't really see any way to automate setting the $magicWords variable from the i18n file either.
Add a template that lists restricted patch templates.

Yeah, I would have preferred to have wiki links there, but apparently these don't really work with recursiveTagParse?!?
Show the list of restricted patch templates on blocked edits.

... and all it took was a change to the system message. Nice.