Reorganize, add getpass() implementation