Added dict sanitizing to prevent invalid hash comparison between str-keyed dicts and unicode-keyed dicts.

Added tests.