restructured toolbox design

- added undo/redo buttons
- added click events
- added global variables