Refacter addfiles.py to use functions.
Minor fixes to scripts.
Merge branch 'filelist'
I can add the planned improvements later.