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 explicitly needed, so
there is minimal overhead (since files will normally have much larger
metadata anyway).
Add tprotocol.py for protocol specific tests.
Add packhash, unpackhash and readpackedhash helpers to protocol.py

These are helper functions which lets us more easily go to and from a
network-byte order variable-length packed hash, to a simple Python
byte-string.
Initial naive implementation of various git functions to the Client obj

Specifically: list_refs, rev_parse, tags, and rev_list

Corresponding implementations are on the server side.

This whole commit is deprecated further ahead on the branch.
Make get_commit_id generic by accepting a cat function.

This is another commit which is actually buggy, and deprecated further
ahead.
Make get_commit_dates generic by accepting a catfunc.

This is also buggy: it should've been get (and is fixed ahead).
Dummy commit for server-cmd.
Modify the VFS to remember which client it is connected to.

This preliminary commit adds a "client" parameter to all VFS classes and
function calls. This allows VFS objects to call the appropriate client
for bup repository based functions (i.e. git functions/readers).
Mixed changes.

update catfunc to getfunc, since these are separate commands.

Add "get <id>" to bup-server for remote VFS usage.

Rationalize client configurations (Client and RemoteClient are now the
two structures).
More changes I can't remember.
Have bup.Client()'s store the bup_repo path they were initialized with.
Implement generic total_size functionality.
Replace git subcommands with local client object invocations.

This is probably a temporary measure: the continuing work will be to be
replace the entire server file concept, with an object class which
subclasses all the Client functionality to make it network compatible.

This then gives us an easy upgrade path for new wire-protocol versions.
tserver.py tests pass fixes.

Refactor a whole bunch of tests to use the client interface, not the git
interface where appropriate.

TODO: finish implementing RemoteClient function overloads.
More tweaks to allow tests to pass.

TODO: Come to a definitive answer on how to structure the wire protocol.
TODO: Implement the missing overloads in remote client.
TODO: Break the server into an object which can be versioned.
ASCIIfy the server protocol as much as possible.

I don't agree with this as a design goal, but it's consistent for a V1
protocol.
Add RemoteClient support to fuse,restore and web.
More fixups for the ASCIIified protocol.
Re-instantiate bup-dumb-server mode as an implicit Client flag.