add set_toggle and toggle.add/remove utilities

also adds and cleans up tests