Electronic structure, spectra, and classification of excited electronic states of the molecules MoCl4 and MoBr4