Molecular Theory of Capillarity