refractored save and load code to move more of the logic outside of the GUI.
Merge remote-tracking branch 'origin/master'