Thermodynamics From First Principles: Prediction Of Phase Diagrams And Materials Properties Using Density Functional Theory