function renderLayout(layout, config, data) {
  config.container.innerHTML = '';
  var url = [config.layoutDirectory, '/', layout, '.html'].join('');
  loadTemplate(url, data, function (success, error) {
    if (error) {
      handleMessage(messages['LAYOUT_LOAD_ERROR']);
    } else {
      config.container.innerHTML = success;
    }
  });
}
Renders the layout into the main container.
@function renderLayout
@async
@param {string} layout - Filename of layout.
@param {object} data - Data passed to template.