The N = 8 supergravity theory. I. The lagrangian