Change some file names. Fix a bug about CUI mode. Fix tests using external AI programs.