Fixes #95 (Legend is toggling)

Problem was after re-render the visualization, the event handlers were still
on the Legend buttons. Now they will be removed in the destroy method to
avoid that toggling.
Fix small bug: in an anonymous function we have to use self instead of this