Let gen_IM_data set output filename from IM name, and write index tree.
Add total_freq.dat into comment of init_database.c