Store state in behavior tree

Closes https://github.com/PistonDevelopers/sprite/issues/12