AjaxDispatcher: Use Config instead of globals

Also removed a usage of $wgUser, and converted
AjaxResponse to use Config.

Change-Id: Ia9a1e17da26908b81f7f9691445ff75db2fdefb1
Merge "AjaxDispatcher: Use Config instead of globals"