Several fixes, optimizations, and one new feature

- Removed memory leak by unbinding global event handler on destruction.
- Formatting and some clean up
- Fixed declaration of global variables (missing vars).
- A new option for showing no label