add polyfills for JSON and String.prototype.trim