Make UserSession always available, and move global variables to it.
Review Request #4045 — Created April 13, 2013 and submitted
Make UserSession always available, and move global variables to it. UserSession is now instantiated whether or not the user is authenticated. An 'authenticated' attribute is set to indicate the authentication state. Along with this, some global variables used for user state (gUserName, gUserFullName, gUserURL, and gOpenAnIssue) are now part of the UserSession. This required some updates to various unit tests in order to not trip the asserts for an existing UserSession. A side benefit to this work is that unit tests can now be run reliably regardless of whether the tester is logged in (as some code would check JavaScript variables that weren't set for anonymous users).
Ran unit tests when both logged in and out. Went throughout the UI (again, both when logged in, and out) and made sure everything touching the prefs seemed to work. This included the Open An Issue checkbox default and the user information on new comments (username, full name, URL).