Modification of icy planetesimals by early thermal evolution and collisions: Constraints for formation time and initial size of comets and small KBOs