Convert CourseLocator and BlockUsageLocator to Key pattern