Rewrite of the motor handler to avoid blocking calls. Using millis instead of delays.