Add base-level support for extra_data to BaseResource.

Several of our API resources now support custom extra_data values. This
moves the support for this on the JavaScript side into BaseResource,
making it very easy for a subclass to work with extra_data.