add support for wrapping exceptions
Merge pull request #68 from wcdolphin/feat/error-handling

Adds support for injecting CORS headers even in the case of internal server errors.
Decouple the determination of CORS headers from the Flask request and response to make testing simpler