Code refactored and cleaned. Modes and extent being sent and stored through dictionaries. One mode at a time. Mode returns where it was left previously. UI is being programatically controlled.