[Reapply] Add template dependency to Mantle extension

Move all templating related code there.

Do not merge until Ic295745b0 is deployed.

This reverts commit 5914fa7ac4e12cef12a9e847c6f648f667d84f05.
(Previously some Wiki's that did not have Flow did not enforce
the Mantle extension, so mobile broke on these wikis)

Change-Id: I65cac40916fb5216227336a0432d42f136caf7da
Merge "[Reapply] Add template dependency to Mantle extension"