The Measurement of Photon Number States Using Cavity QED