A comprehensive study of Cepheid variables in the Andromeda galaxy. Period distribution, blending, a