Escape js take 2

This just takes the work by @brycecr in #22 and @judith in https://github.com/brycecr/scriptular/pull/1 and combines it into a single PR.