Convert the logic of the mode selection to a state machine
Currently I'm using a variety of different Boolean expressions and it's a mess. I think there is a bug in the logic as I'm running into an issue where sometimes the navigation restarts at the end of navigation. I see this bug less then 10% of the time I run it, nevertheless it's not something I want lurking around.