The cosmic neutrino background and effects of Rayleigh scattering on the CMB and cosmic structure