Modern Theory of Thermoelectricity