Made a bunch of things dispose correctly
Removed most explicit references to Program.theModel
Worked on (de)serialization