nunchuck: add initial nunchuck test code
lib: make i2c code more generic

the nunchuck code uses this.  Need to update all of the other targets.