Adding 'switch' testcase.

Mostly just to benchmark the yield implementation.
Merge branch 'master' into custom_context