making progress on refactoring, especially in brain (formerly robot). made new file called robot to represent external robot state