Plans and the Structure of Behavior