TNL-3296 would have been prevented with this test, adding it now to
prevent similar issues in the future. Squashed commit with doc changes,
review feedback, and run-20-times-to-ensure-not-flaky-then-unmark
all included.
Fixed the edX middleware to lazily create request
context for Mako templates, so that it is based on
any changes made to the request object.
Verified that with this fix the "Instructor" tab is
correctly hidden when a staff member is viewing
the course as a student.