Refactors tm_inflate and tm_deflate to accept type argument.
Adds support for deflate, deflateRaw, and inflate versions.