Introduce plugin.restApi(), deprecate other REST helper methods
Implement REST-related methods on Gerrit (get, post, etc).
REST-related methods on plugin now take plugin URL space into account,
to match GWT UI plugin JS API.
Example:
``` js
Gerrit.install(plugin => {
// deprecated:
plugin.get('/foo', json => {
// work work
});
Gerrit.post('/bar', {bar: 'space'}, json => {
// post succeeds
});
// recommended:
const pluginRestApi = plugin.restApi(plugin.url());
plugin.get('/foo').then(json => {
// work work
});
plugin.restApi().post('/bar', {bar: 'space'}).then(json => {
// post succeeds
});
});
```
Change-Id: I6f537507d76bddec1cac9159cebe1b720ab5caf8