Extensive theoretical study on electronically excited states of calcium monochloride: Molecular laser cooling and production of ultracold chlorine atoms.