Slight refactor of toggle directive and test.