Unified Hamiltonian stability theory