Use an extension function for initializing

Just change it to `$GLOBALS['wgExtensionFunctions'][]`