Remove left over call to ungrafted rig.iter in index-cmd.py

This line was left over from merging and is unnecessary. It may have
been affecting indexing behavior.
Fix a bug with initializing offset positions in GraftWriter

GraftWriter did not track offset positions properly in the deduplication
dictionary, which resulted in subsequent executions corrupting the index
graft_point data and setting it all to 0s.
Add regression test for GraftsWriter not preserving old grafts.

The test checks that trying to store the same grafts out of order from
a previous run produces the same file offsets for the indexer.
Assign minimal metadata to metadata objects in protocol.py

Some nodes will never have metadata, particularly in the case of grafted
paths. So a default blank metadata needs to be sent to keep the protocol
synchronized.
Modify metadata to support storing the git file mode.

In the advent that a VFS node has no metadata, it would be nice not to
break the normal metadata features. This patch adds a new tag _rec_vfs
which stores the git file mode which the VFS falls back on.

This tag will normally never be used unless explicitely enabled, so
there is no overhead.
Add tprotocol.py for protocol specific tests.
Merge branch 'remote-restore-server-protocols' into index-grafts-ce