Rewrite to use mediawiki.api

mediawiki.api has edittoken retry, seems useful here.

Change-Id: I4d611bb82d85891ebf1cc67e20552596eeda327d