VE-1747: Fix PHP errors, introduce config classes

PHP globals are used for OutputPage and ResourceLoader to avoid rewriting them to use ConfigFactory. ConfigFactory and related files are ported to support the multiple uses within VisualEditor.hooks.php.

Changes:
Ported ConfigFactory and related classes
No longer checking MW version