allow password generation (currently for testing purposes), and add test cases