make it work with mediawiki 1.22.1

I think it is a dirty patch

Add couple of lines to cope with some cache objects,
and also make use of MediaWiki's AutoLoader.php

Not sure if $IP variable can be replaced with MEDIAWIKI_PATH,
however it runs without problems