Honor language=xx option in parserTests.txt

This patch implements the language=xx option in parserTests for
wt2html.  This may expose some failures in l10n.  In particular, the
tests are now run in the 'en' prefix by default (as thay are in the
PHP parser tests), and the linktrail and linkprefix for 'en' become
significant.  A bug in the WikitextSerializer is also
exposed in the "Simple category in language variants" test case, which
doesn't properly normalize the category link name when the locale is
set.

This is an unrevert commit with an additional error-handling mechanism.
I've made this commit primarily so I could rebase it on top of another one.

Change-Id: I11a992c157e6d4068846f80a0d9ee1a7aca815d7
Merge "Honor language=xx option in parserTests.txt"