Molecular mechanics of binding in carbon-nanotube–polymer composites