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

Major changes:

* Clear out all Toolserver stuff.

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

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

Removed:

* Constant KR_SET_AS_PRIM_DBCON.
* Constant KR_KEEP_PRIM_DBCON.
* Method GlobalConfig::getDbConnect.
* Method GlobalConfig::setDbConnect.
* Method GlobalConfig::getDbExtraConnect.
* Method GlobalConfig::setDbExtraConnect.
* Method GlobalConfig::getAllDbConnects.
* Method GlobalConfig::getRunlogFlushCount.
* Method GlobalConfig::setRunlogFlushCount.
* Method GlobalConfig::getRunlog.
* Method GlobalConfig::setRunlog.
* Function kfCloseAllConnections.
* Function kfConnectRRServerByDBName.
* Function kfConnectToAllWikiDbServers.
* Function kfConnectRRServerByHostname.
* Function kfDoSelectQueryRaw.
* Function mysql_object_all.