fix for adding the same key multiple times
fix up various errors in tests
fix memory issues
restructure slightly so that coverity check is cleaner
need to check for 1 less than max so null character can be added
Merge pull request #3 from lwes/hash_fix

Hash fix