function toVLQSigned(aValue) {
  return aValue < 0
    ? ((-aValue) << 1) + 1
    : (aValue << 1) + 0;
}
Converts from a two-complement value to a value where the sign bit is
placed in the least significant bit.  For example, as decimals:
  1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
  2 becomes 4 (100 binary), -2 becomes 5 (101 binary)