Wikia code/maintenance/update.php

Merged one part of it here: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/97526 There are still changes remaining below: