Skeleton for Tree.Decode and Tree.Encode

Signed-off-by: Solomon Hykes <solomon@docker.com>
Move git primitives to git.go for clarity

Signed-off-by: Solomon Hykes <solomon@docker.com>