Reimplemented API helper

Refactored `Environment#on_wiki` to derive an API URL (from the wiki
URL) when no explicit configuration for `:mediawiki_api_url` or the
equivalent for the given alternative is found.

Refactored ApiHelper mixin to use `Environment` methods.

Change-Id: I4c3ee50c1f1533e3c802f53603c8d4761cbb18c3