Connection runner

Connection logic moved almost entirely into a new class called ConnectionRunner.