mod_compression: refactor code. (Fixes #127)