Add file chooser for saving and loading
Clean up some code