Protostellar and cometary detections of organohalogens