Thermodynamics, an introductory treatise dealing mainly with first principles and their direct applications