Fixes minor bug with updating menu events.

Refactored toolbar button for module pattern which makes the code a lot
cleaner and fixes a problem with the event handlers.