Add support of gzip in dumper (closes #22)

Also this PR adds better workaround to fix #29