Refactored BearScript - now script is run in a single thread for each session (draft).

And each plugin switch is a phase.