Encode data before sending it through AJAX

Without this patch, ckan.js breaks with a JSON like:

```json
{
    "name & gender": "Sam & female"
}
```

Because the ampersand isn't escaped.
Merge branch 'master' of https://github.com/okfn/ckan.js into use-qs-not-json-body