Refactor|libcommon: Switched p_saveg.cpp to C++

Plus cleanup.