More robust templating (#1157)

Don't require $source and $dest to be bare tokens.
Fix convert tests

Use some shell trickery to get the pipelined command to work.