Characterization of chemical and optical modifications induced by proton beams in CR-39 detectors