Bug 990047 (1/2) - Add a shared function to load JSON files

Add a shared function to load JSON files
and use it throughout gaia to replace the
existing ad-hoc functions
Add the error argument to the ``onerror`` callback so that you can pass it to ``reject()`` later, i.e.:

```javascript
xhr.onerror = function(error) {
  reject(error);
};
```

This allows the caller to figure out what went wrong.