Measurement of B (B -> Xs gamma), the B -> Xs gamma photon energy spectrum, and the direct CP asymmetry in B -> Xs+d gamma decays