Lectures on the Mechanical Foundations of Thermodynamics