Refactored hash table.

Cleaned up hash table interface and modified the implementation to store
copies of the keys. This will allow better lookups and will avoid
conflicts and race conditions when adding entries which keys are just
temporal strings.