Added synchronous versions of connect and login.