Middleware tests

These commits add unit tests around most of the edge cases for the middleware. Included is also the the commit from the pull request about the MEDIA_URL issue.

There are two integration tests (the two original tests) for the middleware that rely on the test_project, but are in stronghold/tests/middleware.py. I'd like to move these integration tests to somewhere in the test_project, but there isn't a good place for them right now. Any thoughts?