Reworked implementation of custom error definition

Implementation has been reworked based on discussion from #280 and #221.
Passed implementation has been removed.
Typo. Also, make this a new-style class.

```
class ResourceDoesNotExist(object):
```