Fixed CPrimitive.replace so it quotes replacementValue

Hi,

Using constretto on windows, revealed a bug in CPrimitive.replace. I've included a testcase that reproduces this. As well as a fix.
Could you please merge this patch?

Thanks!