Added login option to wikitext editing workflow.

Various small bug fixes and refactoring too.

Change-Id: I1d4824e3390b0ecfe7cebed9debeb5623bd981b9