reorganized GUI modes code; added currentMode var

added on-enter-mode actions for each mode