Replace slow STL hash table with a custom implementation.