Fix errors caused by hashing data in head

The data backing a table was being hashed while computing head. This
commit changes the traversing behavior to avoid this, and also changes
the hashing behavior for Table.

The hash of a Table object is now a hash of the schema, the name and the
id of the data.