Toggle classes on click in example, and fix for dynamically added nodes