Replace custom encoding logic with as_json

In case of Strings the old method fails to escape nested (preescaped)
quotes, e.g.:

"CoffeeScript.compile.apply(this, [\"localStorage.setItem...\")"

was wrongly encoded as:

"\"CoffeeScript.compile.apply(this, [\"localStorage.setItem...\"])\""

Using the raw generator, we get the following result:

"\"CoffeeScript.compile.apply(this, [\\\"localStorage.setItem...\\\"])\""

The same applies to nil, true, false and the to_json/to_s fallback.

To simplify the encoding logic this commit uses the as_json convention
and relies on JrJackson::Raw to produce the correct output.