Added logout functionality and refactored capybara for login and register