Improvement and fixes for tar file reading, started work on tar writing...

Signed-off-by: Frank Mertens <frank@cyblogic.de>