check error before flush buffer
replace string manipulation with csv.writer
extract main method to another file
support GO version 1.3
update readme.md