Quasiparticle bands and optical spectra of highly ionic crystals: AlN and NaCl