Phage genetics and ecology