KWin echo hack and string literal fix.

Uses `print` instead of `console.log` and a bit of code copy/paste.

Also replaced `makeCString` with `makeJSString`.