iconv/compress: code clean up, modulize test