Add custom logger support. Refactor response error handling. Clean code to follow reek style guide.

I would rephrase this a bit:
Logging is disabled by default, it can be enabled by setting a logger instance and a logging severity.