Refactor writer.go

Signed-off-by: Vlad Velici <vlad.velici@gmail.com>
Format action done for Tag format

Fix: writer wasn't adding "#" before comments
Fix: flagConvert was being validate regardless of whether the action is "convert"

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