Hamiltonian structures for integrable classical theories from graded Kac-Moody algebras