there is a difference between Site.lang and Site.code in rewrite
- fix it
- preload pages only if it we have to
- some improvements

https://mediawiki.org/wiki/Special:Code/pywikipedia/11740