[IMPR] Reduce code complexity of update_page
[IMPR] Reduce code complexity of update_page

- Reduce cyclomatic complexity of update_page from E33 to C17
  and improve readability by splitting code in parts.
- Raise RuntimeError instead of AssertionError when neither 'pageid' nor
  'missing' attributes are given because this is more a runtime problem
  than a debugging stuff.

Change-Id: Icf17030707e5a0c63e769cee2f48c3ab0be95b59

wikimedia/pywikibot-core,wikimedia/pywikibot-core,PersianWikipedia/pywikibot-core