Merge 159 and 162

In this PR I will merge the PR #159 and #162 and try to add signature to logout request and response
the format methods only do a pre-massage in order to avoid typical copy&paste problems:
extra spaces, extra newlines, ...