Nonlinear and Hamiltonian extended irreversible thermodynamics