Use djb2 hash in dict module

This slightly modifies the string hashing function to use the djb2 hash.
This hash is supposed to be reasonably fast and have reasonably few
collisions.