Logout function added. Refactored file names, etc.