Make code safe for unicode course ids

@adampalay @mattdrayer