PROTON-589
Fixed test failures and cleaned up the code.
A few more improvements could be made.
Currently 2 SSL tests are failing, but not sure if they are genuine test
failures.

git-svn-id: https://svn.apache.org/repos/asf/qpid/proton/branches/rajith-messenger-passive@1604907 13f79535-47bb-0310-9956-ffa450edef68