Add an example for the connection class

Also, change around the other examples to use the connection
example so there isn't duplication of code for session and
authentication.

Change-Id: I90dbcfac3eae0c792bd9c4eae071de7d81e1b27d
Merge "Add an example for the connection class"