Measurement of the branching fraction and photon energy moments of B -> X-s gamma and A(CP)(B -> Xs+d gamma)