Classical and Geometrical Theory of Chemical and Phase Thermodynamics