Subclass Error and implement toJSON

The returned error can be converted to json with JSON.stringify.
Updated JSDoc for ResError

A note about converting the error to JSON.
Merge pull request #3 from Springworks/feature/subclass

Subclass Error and implement toJSON