Added whoami(), use it for reevaluating auth.
Added logout.