Add mode management for the robot.

Add AI and state mode management (set/get state and AI mode from the
network) to the robot module.