Fix docstring that was full of lies
Refactor connection stuff for easier testing