Changed BehaviorTree and Coroutines API.

Added tests.