Molecular simulations of viral DNA packaging and ejection in bacteriophage Φ29