Check uniqueness in .add_hashed_value and add tests

Tests pass, but aren’t exactly following previous style (not yet
comfortable with py.test). I think this is more or less OK, but