Major clean up of the test client.
Added additional commenting and cleaned up redundant or old code.