Electronic structure of the pyrimidine and purine components of nucleic acids in their ground and lower excited singlet and triplet states