Big refactoring of PageRenderingHooks to avoid globals

* PageRenderingHooks now maintain one singleton instance of PageRendering class,
and most methods of that class are now non-static.
* Consolidated main page URL generation
* Consolidated $wgDBname parsing into getWikiInfo()


Change-Id: I167613b5235dc356b050e2e344b564a5a8327b02