Nonequilibrium Thermodynamics and Its Application to Bioenergetics