Adds hash validation to snaks and references deserialization

Allows to validate deserialized data