Consolidate most pstat code into one file.