fixes issue #21. Attempt to use JSON.stringify() and only use json-stringify-safe if there is a problem with the native JSON serializer