Add tests for key hashing. Implement a _real_ hash function.