Improved zoom/pan
Fixed bugs in UI code (Capturing for root)
Added double click event for button panel (not tested)
Refactored some code