Replace the bits of labsmediawiki that aren't wikidata-related.

This whole file was excised in https://gerrit.wikimedia.org/r/#/c/132605/
but some of this file was actually good for things.

Change-Id: I69deb6966e486f53a81670fb303263ab25440096