Optimize hash function.
Add hashmap.maybeSet (set if missing).

Also fix a bug in hashmap.set when not replacing.