Refactor Build.sh to avoid repeated code

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Build.sh: remove obsolete artifacts before going on

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Adjust MediaWikiClient to match yet another MediaWiki installation

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>