Wrap config templates in quotes so spaces in filenames are handled correctly

Also improved logic to determine whether we're in a local or installed version of autowiring.