Store state in behavior tree

I can't test examples yet, requires review.

Closes https://github.com/PistonDevelopers/sprite/issues/12