Added stuff in to do a save state.
Save State skeleton here
Need to make some changes for save states.
Now can write savestate files
Added save states