fix writer class

gzip doesn't have support for with statement, so this probably shouldn't
have it either.  fixrd init function to use either a text string or a
file object