Bug fix: compression was always disabled. Removing debug statement.
Adding unit tests.
Compatibility fixes for Python 3.x and 2.6.