Core formation and chemical equilibrium in the Earth—II: Chemical consequences for the mantle and core