SECURITY: Make Widget replacements more reliable
This makes the marker/replacement functionality more reliable. In
certain cases this improves security. See T149488 for details.
Also store the widget replacements in the ParserOutput instead of
as a static member, so it stays with the correct page. This feels
like it is safer when there are multiple parses going on although
in pracise it should not make a difference.
Bug: T149488
Change-Id: I5caae562e88edd7868cd87988db4f23548e08045
(cherry picked from commit f86713e332d0433119d4dda21fd7d20df4d48088)