Added usage and cleaned some unused code.
Handling empty content-transfer-encodings and adding some more detailed logging.