Hygiene: Share onSave code between VE and wikitext editors

Change-Id: I572522866b5d671f91187f9be89fe19ab8ec67ab