changed returned errors to be an Error object rather than a plain object with an error property. Also added uri and tonce to error messages
Merge remote-tracking branch 'origin'