Update for MediaWiki 1.21 and add basic test

Change-Id: I0c05be587e9c458118eba9779e6573514a44e547
(cherry picked from commit ebb415d34f9dab8420465e125bc9b3cff5d10a54)