Use mwapi for anonymous API requests
I first wrote the anonymous API requests using urllib.request.urlopen(),
then later added the mwapi library for OAuth requests – but we might as
well use that library for anonymous requests as well, it makes the code
nicer and also gives us better error handling for free.
Also use formatversion=2 for authenticated requests, while we’re at it,
now that I learned about this Session constructor parameter.
Note that this has the effect that we now get image metadata
(attribution) from www.wikidata.org instead of commons.wikimedia.org,
but that’s not a problem, since MediaWiki supports that.