Basic session implementation on client.

Added sessions for the client.  Saves the user object to preferences and
then uses that to log in.  If that fails, defaults to the old login
process.