Requests for comment/Linker refactor

Static functions are widely used throughout the MediaWiki code base. This introduces procedural code, global state and makes it quite a challenge to do good unit tests of the MediaWiki code. It is difficult to isolate pieces of code and test each piece, each class, each method and is not possible to mock the static methods of another class.

Some of the most egregious uses of static functions is in the Linker class. Linker static functions are used nearly 500 times throughout MediaWiki. Especially heavy use occurs in special pages, ChangesList / Enhanced Changes, Difference Engine, etc., making them difficult to test fully.

MediaWiki should move away from using static functions and move towards turning utility classes like Linker into service objects. Then other classes using Linker can mock out those methods and isolate their own methods for testing.

Justification

 * Improve testability and code quality of MediaWiki
 * More bugs caught via tests and prevented from making their way into production

Implementation

 * Introduce a new Linker (name suggestion please?) service object class
 * Phase out / deprecate the static methods in the current Linker class