Refactor connection host/port. Closes #2112. Closes #2113