Calculation of electron-impact excitation and ionisation cross sections and reaction rate coefficients for C, N and O atoms