Added root option, made loadTemplates take an options arg