Another big restructuring because it turns out the last one was a
horrible idea. This is basically a better version of the last
restructure. The GUI is now much more responsive and the data structure
is in general better...