Saves JSON data to a file, or erases the file if data is null

@param filename {String} filename to write to
@param data {Object?} the data to write
async function(filename, data) {
      if (!data) {
        if (await fs.existsAsync(filename)) {
          fs.unlinkAsync(filename);
        }
      } else {
        await fs.writeFileAsync(filename, JSON.stringify(data, null, 2), "utf8");
      }
    }