Processes the provided template, replacing variable placeholders with the
values of the variables, and evaluating all conditions.

@param {string} template The template.
@param {Object<string, *>} variables The variables and their values.
@return {string} The processed template.
function processTemplate(template, variables) {
  for (let variableName of Object.keys(variables)) {
    let value = variables[variableName];
    template = replaceVariable(template, variableName, value);
  }

  template = evaluateConditions(template, variables);

  return template;
}