It converts input dictionaries into swh-model objects, which
validates them and raises an appropriate error.
This removes duplicated validation code that is currently present
in all three storage backends.
It also uses well-defined object types instead of loose dicts,
which gives these _add() methods a more strict type.
Depends on D2641.