Updated I2C Slave code

Based on use with other projects, this code has more comments and should
be more robust.