Make the dump() function const and reduce the number of hash lookups it performs.