Login/Authentication updates & minor refactoring

Added support for sms two-factor authentication, corrected LOGIN URL, removed some redundant/unused imports/variables, refactored open io statements using 'with open' for auto teardown/closing