[SYNC] Code improvements, sync with compat
[SYNC] Code improvements, sync with compat

- reorder classes
- use config variables for line_separator, max_retries, retry_wait

Change-Id: Ife68b1c43c72aed06f1ca146ed79edffa4c8b98b

icyflame/batman,hasteur/g13bot_tools_new,npdoty/pywikibot,Darkdadaah/pywikibot-core,xZise/pywikibot-core,darthbhyrava/pywikibot-local,jayvdb/pywikibot-core,TridevGuha/pywikibot-core,wikimedia/pywikibot-core,happy5214/pywikibot-core,h4ck3rm1k3/pywikibot-core,jayvdb/pywikibot-core,magul/pywikibot-core,magul/pywikibot-core,Darkdadaah/pywikibot-core,npdoty/pywikibot,hasteur/g13bot_tools_new,wikimedia/pywikibot-core,h4ck3rm1k3/pywikibot-core,valhallasw/pywikibot-core,smalyshev/pywikibot-core,PersianWikipedia/pywikibot-core,VcamX/pywikibot-core,emijrp/pywikibot-core,happy5214/pywikibot-core,hasteur/g13bot_tools_new,trishnaguha/pywikibot-core