Classical and Quantum $${\mathcal {W}}$$-Algebras and Applications to Hamiltonian Equations