Configuration-interaction study of atoms. I. Correlation energies of B, C, N, O, F, and Ne