Fix bugs; consolidate storage of events; add preference to vibrate on switch