imaptest is compiled against libdovecot, but it's not yet using connection.c for connections. Convert imaptest to use this.
Benefits:
Connection.c handles several connection handling issues better than the old self-made code does, and allows more easily to enable debugging on connection issues.