Charge-Density Wave and Superconducting Dome in TiSe$_2$ from Electron- Phonon Interaction