Change mime headers to x-gtar instead of x-tar

Signed-off-by: Andrei Dinin <adinin@pivotal.io>
Refactor to reduce duplicated lines

Signed-off-by: Andrei Dinin <adinin@pivotal.io>