function writeSettings(data) {
    const configKeys = Object.keys(data);
    const writePromises = [];
    configSections.forEach(key => {
        const sectionData = data[key] || {};
        delete data[key];
        const sectionFilename = getSettingsFilename(key);
        const sectionContent = JSON.stringify(sectionData,null,4);
        if (sectionContent !== settingsCache[key]) {
            settingsCache[key] = sectionContent;
            writePromises.push(util.writeFile(sectionFilename,sectionContent,sectionFilename+".backup"))
        }
    })
    // Having extracted nodes/users/projects, write whatever is left to the runtime config
    const sectionFilename = getSettingsFilename("runtime");
    const sectionContent = JSON.stringify(data,null,4);
    if (sectionContent !== settingsCache["runtime"]) {
        settingsCache["runtime"] = sectionContent;
        writePromises.push(util.writeFile(sectionFilename,sectionContent,sectionFilename+".backup"));
    }
    return Promise.all(writePromises);
}
Takes the single settings object and splits it into separate files. This makes
it easier to backup selected parts of the settings and also helps reduce the blast
radius if a file is lost.

The settings are written to four files:
 - .config.nodes.json - the node registry
 - .config.users.json - user specific settings (eg editor settings)
 - .config.projects.json - project settings, including the active project
 - .config.modules.json - external modules installed by the runtime
 - .config.runtime.json - everything else - most notable _credentialSecret