Use a stack to manage contexts
Merge branch 'context_switching'