when generating javascript, escape keys with slashes