Adjust to take into account quoted strings

There's some oddities in stripping quotation marks from an empty string.
Using the %~N syntax takes into account quoted strings and strips the
quotes from it.  I've tested this in Windows XP.

Side benefit -- it's easier on syntax highlighters.

cc: @asmeurer @mwiebe