Heavy refactoring of connection pool code. Vibe's locking functions also
doesn't work properly, threads are rewritted within message based approach.