Jhbate/cleanup

@kentquirk - some more cleanup while i was looking at the logout and message issues. I just added common code for the puts and post calls (as we already had for get). Also in the tests on the after I now do a logout.