tag.Writer fixes

Signed-off-by: Vlad Velici <vlad.velici@gmail.com>
Initial convertion implementation

Fix autodetect. Auto-detect format does not work on stdin (no extension and difficult to buffer stdin to be re-read)

Signed-off-by: Vlad Velici <vlad.velici@gmail.com>