added xbee library and generalized IO
condensed XB and IO to libraries