CONEXT-25 logout

This patch allowed us to support single logout, note that this was based off a much earlier release of your code which caused us some conflicts when merging with `master` on our own deployment.