Restructure, and some GUI work