Electronically excited and ionized states of the chlorine molecule