refactored generatePassword() in user generator

also fixes issue 94