Kinetics and mechanism of reactions of formaldehyde and related compounds with ammonium and alkylammonium salts