Implemented basic 'switch context' functionality.