What is thermal energy?

A. The transfer of chemical energy between molecules
B. The difference in potential energy between two states
C. The average kinetic energy of molecules in a system
D. The total kinetic energy contained in a system