Added error checking with diagnostic messages.
Connected property is working now as inteded.
Added device index property for motors and sensors.
S4 classes now use constructors as initializers.