[WIP] Clean up database interaction and migrate to Wikimedia Labs

Highlights:

* Clear out all Toolserver stuff.

* Drop "Main connection" concept and instead only use
  named connections.

* Update mw/Html.php and related mw mocking.

Interface changes:

* Function kfLog no longer takes a $current parameter, use kfLogStart()
  and kgLogEnd() to group information for profiling and logging.

* Function kfWikiHref now takes $wikiInfo instead of $wikiData.

Removed:

* Constant KR_KEEP_PRIM_DBCON.
* Constant KR_SET_AS_PRIM_DBCON.
* Method GlobalConfig::getAllDbConnects.
* Method GlobalConfig::getDbConnect.
* Method GlobalConfig::getDbExtraConnect.
* Method GlobalConfig::getRunlog.
* Method GlobalConfig::getRunlogFlushCount.
* Method GlobalConfig::setDbConnect.
* Method GlobalConfig::setDbExtraConnect.
* Method GlobalConfig::setRunlog.
* Method GlobalConfig::setRunlogFlushCount.
* Function mysql_object_all.
* Function kfCloseAllConnections.
* Function kfConnectRRServerByDBName.
* Function kfConnectRRServerByHostname.
* Function kfConnectToAllWikiDbServers.
* Function kfDoSelectQueryRaw.
* Function kfGetAllWikiSelect.
* Function kfGetWikiDataFromDBName.
* Function wikiDataFromRow.
* Function kfStripStr.
* Function mysql_clean.
* Function kfGetSvnInfo.
* Function kfGetSvnrev.
* Function kfQueryWMFAPI.