updated templatizer() method to optionally accept an array of template directories