Migrate to JSON i18n

Procedure per https://www.mediawiki.org/wiki/Manual:GenerateJsonI18n.php
with shim.

Change-Id: I977a8a86e26afc530e2c2b00e511a8c002791c90
Some cleanup

* $wgExtensionMessagesFiles was used twice.
* Remove trailing whitespaces
* Use __DIR__ instead of dirname( __FILE__ )

Change-Id: I546748b117b3b7bbd0c4c3fff45f56270fa06753
Changed wfMsg to wfMessage, check whether $tilte is defined.

Change-Id: I0a87eb9a98ceba0c376e3972333ce6d2e53795a4