Added Logout function and a logout link to sidebar.