Automatically update mains.dat filenames. Closes #35