Add deflate encoder and decoder unit tests.
Refactor following the feedback.