Accept an Array (as well as string) for options.exec

When an array is given, don't do any splitting on spaces.

This is a simpler alternative to #418 which doesn't affect the CLI interface, just the API. Although it does fix a bug in the CLI's `{{filename}}` and `{{pwd}}` expansion as a side effect, which I've added a test for too.
But from an API point of view, which is more reasonable?

 - pass an array of arguments
 - pass a sequence of arguments as a single, shell-style space separated strings

It is definitely not normal for an API to use the latter, and the former is obviously a cleaner way of passing around a list of arguments. Plus, there's no existing usage to contend with. We can be sure that nobody is using arguments with spaces in them right now, since it doesn't work.

Now, if you want to make it so that command-line users can properly pass arguments with spaces in them, you might want to *additionally* implement shell-style parsing when `exec` is a single string. But that is not in scope for this PR, I'm just trying to improve the API.

For the use case when someone sends a single string,