Add support for sparse entries.

This also should also improve the memory efficiency, but I didn't bother getting numbers on that, I needed it for the functionality anyway, it's just a happy coincidence. :smiley: 
Sorry, got confused and thought `dense_entries_` was a map when I wrote that.
But you could CHECK that the returned hash is the right length for the configured log hash function.