Check if API enabled before loading dependent JS modules

Affects whether these modules are loaded:

* mediawiki.searchSuggest ($wgEnableAPI only)
* mediawiki.page.watch.ajax ($wgEnableAPI, $wgEnableWriteAPI,
  'writeapi' right)
* mediawiki.page.patrol.ajax (same as above)

Checking of $wgUseAjax has not been removed where it was
already present, in case some users have set the variable
to false to disable these specific features.

Bug: 30213
Change-Id: If2ec219cfbb94e7c9718c58b9b54a508d0e0c656
Merge "Check if API enabled before loading dependent JS modules"