refactored out some methods
removed handling of NPE since its never thrown legitimately
handleAcceptedSocket is extracted and its errors caught and logged
shutdown agency on an exception
Merge pull request #2 from kashifrazzaqui/crash_on_exception_in_agency

shutdown agency on an exception
Merge pull request #1 from kashifrazzaqui/fix_crash

Fix crash