Saving and loading implemented. GlobalData class added.