Partially resolving a template

I needed the possibility to resolve a template partially, returning a new template with any unresolved expressions/variables left.

I've attached a first attempt at something like it and thought you might be interested in having a look? Not sure if you're willing to take pull request on this. If not I'll just keep it in my fork.