Fix bugs in the toggleable parts

Fixing two bugs:
 * Event handlers on toggleable elements were not unregistered when resetting the exercise. That caused the click handler to fire multiple times after reset. 
 * The selected toggle value was updated *after* logging, which caused the logged data to not be the correct state.