Breaking out advanced functionality into own class.  Simple toggle-switch functionality now defined in toggle_switch.js.