Writes metadata index files