Make authentication functions static
Added basic login/logout support.