Implement Repository.hash

This takes a string of arbitrary data (That may include null bytes) and
returns it's sha1 hash as though it were a blob, without actually
writing to the object db.
Add tests for hash