Refactor code, add basic test case
Add test case for masquerade mode
Merge branch 'master' into Issue1841
[1841] Clean up InstructorCourseDetailsPageAction

fixes #1841