Don't error on unexpected encodings

Do not error if the URL, query string or post data contains unexpected
encodings.
Try log an exception when logging fails.

Also move logic to get the message from the
request into a private method. There was starting
to be too much logic in the tween.

The rational for logging an exception when logging
 fails is that often this component is used just
before one which converts all errors into
ServerErrors (500) thus hiding any exceptions
while logging.

Error handling is in a separate function, this removes a circular
reference caused by saving the traceback as a local variable. The
function which gets the traceback is not being called when the error is
raised, so it's local variables are not referenced by the traceback.
refactor tests and code to pass on python3
Top-down, more or less.
PEP8:  wrap 80+ column lines.
100% coverage.