A bubble chamber study of proton-proton interactions at 4 GeV/c Part I—Elastic scattering, single-pion and deuteron production