WIP: keepalive code completely moved to Connection, some test fail for now