Replace some deprecated functions

* Raises minimum MediaWiki version to 1.19.
* Removed unused globals and local variables.

Change-Id: Ic799b25fcc2cd1a270eeaad62a754a205e7c45a2