Allow default response override, easier to override middleware functionality

These are some changes that I made to make the app work for me at my job. Here's a brief list of the changes:

- Allows overriding the default response_code (for us, 302 was a much better default). Maintains the existing default of 301 without override.
- Broke middleware process_exception into more classes so it is easier to override small pieces of the middleware without replacing the whole thing.
- Added tests to setup.py so they can be run as part of install.
- Updated tests.
- Some style changes to match PEP8.

Let me know what you think and if there are any issues you'd like to flag.