(ess-replace-regexp-in-string): New function, reapplied from Camm's