First part (the syncing) of refactoring to be a MediaWiki extension.