connection: allow passing a credentials object. fixes #136.
Merge pull request #145 from stephenplusplus/credentials

connection: allow passing a credentials object. fixes #136.