Interpretation of the x-ray photoemission spectra of cobalt oxides and cobalt oxide surfaces