Since there are at least three places where the speed is being conditionally inverted, what do you think about centralizing the operation? While reading this patch I've thought of a handful of possibilities—all have merits, but I want to hear your input:

\1. A get-only accessor:
```js
// ... 
shouldInvertPwm: {
  get: function() {
    return this.invertPWM === true && this.direction === 1;
  }
}
```
\2. A "private" speed normalizer: 
```js
function normalizer(motor, speed) {
  if (this.invertPWM === true && this.direction === 1) {
    speed ^= 0xff;
  }

 return speed;
}

// and then all places that have the if statement are just replaced with: 
speed = normalizer(this, speed);
```
\3. Turn `this.speed` into an accessor: 
```js
// Assumes that a speed property is stored in a state side table...

speed: {
  get: function() {
    var speed = priv.get(this).speed;

    if (this.invertPWM === true && this.direction === 1) {
      speed ^= 0xff;
    }
    return speed; 
  }, 
  set: function(value) {
    priv.get(this).speed = value;
  }
}
```


(Sorry about the "\" before the numbers, github markdown was turning the list items into "1." for everything)