Compresses a string so that it can be embedded as a variable in JavaScript.