mediawiki.toc.test: Cleanup

Used consistent wording, fixed some typos ("visible" and "hidden" were
swapped in one place, etc.) and simplified the flow.

Change-Id: I7745aa48484fb1a36f8b2654f2a3df326b43c9c4
Merge "mediawiki.toc.test: Cleanup"