Hygiene: Cleanup the toggling test code

* Use a template for the section heading
* Stop using the global variable container
* Refactor toggle.js to make it more testable

Change-Id: Iddb06a5d8dc52bc417c894abda989d046ee39ca3