Clean up LocalisationUpdate

* Delete dead code.
* Refactor duplicated code.
* Fix cache checking logic, particularly for extensions.
* Un-hack saving logic; the "hacked" version is now cleaned up as the
  standard.
* Fix cache saving to only write if necessary, so
  rebuildLocalisationCache.php won't needlessly rebuild every cache.
* Remove "skip if files identical" check: it was broken in the old
  version, and if done is wrong anyway because we still need to save all
  the messages for correct fallback behavior.

In local testing, an update + rebuild with empty caches takes about the
same amount of time, while subsequent updates + rebuilds are much
faster (mainly due to not rechecking every extension even when not
updated and to not touching the cache when nothing changed).

Change-Id: Ib701e12d7bd694b3716924f3e574132c9c844277