git-remote-mediawiki: split get_mw_pages into smaller functions