Improvements to allow the choice between command line and getpass