Revised tests to avoid shared state between tests.
Failed connection attempts now cause the thread to sleep.
Added empty handlers; marked various classes as public.