Toggle: onbeforeprint behaviour

1. Allows a toggle element to turn the elements it controls on/off before the page is printed.
2. Fixes a bug with the `type` option if the `stateOn` option is used.
3. Adds unit tests for onbeforeprint behaviour.