Major refactor of GUI code into an MVC pattern.