Add connect() and associated test