Just some general cleanup in the HashMap module

I went through the HashMap module, fixed spelling mistakes, minor
inefficiencies, added tests, and other trivial changes.