COOPR:629 Update template APIs to support extending templates and including partials

@jwang47 Branch ready for review.
We made a lot of things mutable sets due to how we're merging the template here, right?