NVU dynamics. III. Simulating molecules at constant potential energy.