Moved SaveSpec to its own file, and made it pass functions to save/load refs to the saving/loading functions directly rather than using global methods.