Refactored to add link to upload and wrap login/logout links to functions.