improvements and changes to make build result more suitable for wikimedia use

most important changes:

* use --prefer-source so we maintain the git history in the build, can apply patches if needed, etc
* use --optimize-autoloader to dump class map for improved performance
* make sure wikibase master gets used (for me, it was getting dev-REL1_22 of wikibase, which is quite old)