Resource server errors

Copies helper methods for exception handling from the Authorization server into the Resource server to allow for implementing [RFC 6750, section 3.1](http://tools.ietf.org/html/rfc6750#section-3.1):

- getExceptionType
- getExceptionMessage
- getExceptionHttpHeaders

Adds `$required` parameter to `hasScope` to trigger exceptions when scopes are missing from the session.

Adds two new exceptions, `MissingAccessToken` and `InsufficientScope` to differentiate between the different error responses from the resource server.

Tests updated and new tests written to complete code coverage.