Rotation and activity of comets