Dynamics and thermodynamics of complex fluids.  I. Development of a general formalism | Synapse