refactoring code

motors, motor positions, and motor labels are all create now by looping
until reaching the specified number of motors. (And we could get this
number of motors when connecting to a robot). Going to continue in the
same manner, replacing old repetitive code