Generalized toggling implementation.

Now it is done as the visualisation suggests: whenever clicking on something
which is being highlighted then return to default state.
Cleanup.