Fix bugs introduced by a code cleanup pass prior to the first GitHub submit.

1. Infinite loop when reading/writing arrays.
2. Incorrect event types in listen() and mdnsAdvertise().
3. Incorrect packet type and failure to write data array in send().

For 3., converted data send functions to the same mechanism as command send functions.

Disabled all debug levels by default, and wrapped some errant prints in debug level macros.
Code cleanup & documentation, bug fix.

1. Added documentation comments to internal HCI functions.
2. Organized functions logically.
3. Renamed wifi_init -> wlan_init for consistency with other wlan_ functions.
4. Removed unused #defines, cleaned up remainder.
5. Removed unused / unneeded global variables, made internal ones static.
6. Removed unused global variable listen_socket.
7. Moved variables to explicitly sized types.

Fixed a bug (symptomless as far as I know) where the first HCI command didn't properly initialize its payload size or padding state.
This should have resulted in a bad HCI communication sequence, but it somehow seemed to be working.
Watchdog and select() support

1. If USE_WATCHDOG is defined, resets the watchdog timer at appropriate spots.  (The watchdog timer is a feature which automatically resets the chip if the timer isn't reset after a period of time, allowing the micro controller to recover from occasional hangs). Generally, the watchdog timer is reset immediately prior to communications with the CC3000, but not during inner loops.  Thus, if the CC3000 hangs, the watchdog is capable of resetting the micro controller.  (And the micro controller will then presumably power cycle the CC3000)

2. Implemented the select() socket function.  This is used by, among other things, the Adafruit CC3000 library.