The cosmology of composite inelastic dark matter