Toggle: add toggle state persistence

The "persist" data option allows a toggle element to remember it's on/off state using localStorage or sessionStorage.

Fixes #857, #2620.