Generalise connection.rb, move into driver_common