This commit adds a new field called ref_states to the ProjectIndex. This
field can be used to perform staleness detection based on NoteDb ref
states. We store the HEAD SHA1s in 40 digit hex notation for the project
in question as well as all of it's ancestors.
Storing the ancestors ref states as well is necessary because the index
stores the names of all ancestors, so we need to detect when the
project's hirarchy changes and we get out of sync.
This approach follows what was done for changes, accounts and groups.
A subsequent commit will build a staleness checker and wire it up.
Change-Id: I08efd4286b4fd5c577c0863802bcdf051972f5cf