Add an `EndpointError` class.

Libraries like `hapi` and Node's domains (via `domain.bind` and `domain.intercept`) may assume that error objects inherit from `Error`. This pull request adds a small `EndpointError` class that constructs extended error objects.