Dynamics of mechanical metamaterials: A framework to connect phonons, nonlinear periodic waves and solitons