Ion-molecule chemistry of dense interstellar clouds - Nitrogen-, oxygen-, and carbon-bearing molecule abundances and isotopic ratios