Requests for comment/Page protection as a component

Rationale
Make the article protection model easier to maintain and extend.

The system is not written in a modular way, and to decouple from core code we might as well expose the internal API, then move the implementation into an extension. This will have the great benefit of making it trivial to experiment with improvements to page protection, or for administrators to replace its functionality entirely in favor of a model which better suits site requirements.

The core access control system currently in question consist of: a) "protected titles", or a blacklist of titles which are banned and cannot be created; and b) "page restrictions" or "page protection", which prevents editing by role, and can be cascaded to protect all transcluded pages or templates. There is also the role-based access itself, but I saw less benefit in extracting this out.

Issues
We shouldn't distribute MediaWiki without a permission model, so the new extension would be bundled in core releases and enabled by default.

The refactored code linked below was overly conservative, in order to lubricate review and acceptance. A later phase may include reorganization within the extension, and tweaking of the hooks added to core.

Resources

 * https://gerrit.wikimedia.org/r/#/c/23999/ - changes to core
 * https://github.com/adamwight/wmf-ext-protection - refactored as an extension
 * https://bugzilla.wikimedia.org/show_bug.cgi?id=40293 - bugtracker for this feature
 * (redlink) Discussion of functional requirements and how strictly we should follow the existing implementation.
 * (redlink) Future directions