First-principles calculations of stability and phase equilibria in the Fe–Ni system