Added some basic Xbee support and cleaned up some of the code to be more readable