Fixes and cleanups, add some timeout processing, convert AJP NIO code.