ipfs-cap2pfs: Add 'type' field to all objects

Git embeds the object type as the first entry in the object's header.
For example [1]:

  blob 16\u0000what is up, doc?

IPFS should do the same (otherwise you'll have to have some heuristics
to guess which type you're looking at when decoding a hash).

With the embedded type information, we no longer *need* to record the
type of linked objects (e.g. in a list or tree's data, or in a
commit's data.type).  Git records this information on the referrer
side too, and it lets you do things like "recursively find all the
submodule commits in this tree" without having to fetch every object
to determine its type.

[1]: http://git-scm.com/book/en/v2/Git-Internals-Git-Objects#Object-Storage