adding bz2 support - adapted from zlib support