Refactor verify course id decorator and fixed tests.
Merge pull request #5010 from edx/waheed/refactor-verify-course-id-decorator

Refactor verify course id decorator and fixed tests.