Initial step in moving out code from SimpleQuery special page

Includes introduction of two simple adapters to abstract away
from MediaWiki design issues. These can later be moved to their
own component, as they are of use elsewhere, and more code is
needed to isolate other users from this legacy API.

Change-Id: If13915c74f7bc4bb7f13ee451e2f589d19439198
Add 'wikibase-query-run' permission and checks

Also add tests for api permissions
REQUIRES: I72b019d509985 in Wikibase

Bug: 56671
Change-Id: I4339cd7a8b908400e3a96197f5da5c639caf1556
Remove copied code in system tests

Change-Id: I3c67f8fc776cf15564239aebf6318bd9c3db8ed6
Update dependency versions

Change-Id: I6d44c2f9e5dbcbc8bef8e5bb4f418e4dcd1dc91d