savefile: move all savefile related code into one file