Add initial GuidedTour tests, with related refactoring.

* Break ext.guidedTour into two modules, one with the main code,
and one that implicitly launches a tour from the environment.  This
eases testability.
* Remove some unneeded semi-global (whole ext.guidedTour scope)
variables.
* Various small fixes, including a couple that are also in other
pending changes.
* Coding convention and documentation improvements.

Change-Id: I604dcc7f41a1ece1fefc8f1ed0d5a78dc5946aa4
Merge "Add initial GuidedTour tests, with related refactoring."