Perform auth checks in middleware

        Includes static server tests.
Put static server middleware after the middleware it requires
Remove cache workaround
Fix order-dependency in tests
Fix middleware order in CMS.

   And include Don's fix for partial course_id lookup.
Review fixes
Merge pull request #1090 from edx/jkarni/feature/middleware-locked-assets

Jkarni/feature/middleware locked assets