Made a first pass at refreshing the Gui code.

It should now be in synced with the mode manager.