add public interface for context switch, minor fixes
Merge pull request #232 from kateyy/context_switch_interface

add public interface for context switch, minor fixes