added documentation about the flags in man
no more "%s" string for inserting in template.

It helps the program to handle every scenario.
written new algo in comments and prepared the template.
handle new template flags system
fixed a reg expression to be coherent with the manual
fixed behavior of '-o' option and enhanced make_raw() code
simplified code for handling out_file