Refactored course_nav middleware to remove the middleware and context

processor.