code cleanup + pan/drag mode separated

new tool added to switch to panning
big cleanup