Teensy 2.0 with MCP23017-E
You have the wrong device address. You've included the R/W bit in the address, which you shouldn't.  An I2C address is only 7 bits, not 8.  Drop one bit:

const byte device=0b0100000; //default addrress of IO chip