Molecular Dynamics in Confining Space: From the Single Molecule to the Liquid State