Added RobotFactory and ability to create robots from input; tidied up the input parsing a little