Cleanup: removed unneeded code and added comments.

First time through reading this test file, I did not understand how
it works.  Hopefully this change makes it a little easier to read.
I added some self-tests to make sure that the client indeed dies as
expected.
Only turn on self-tests for release testing.