add helper funcs & fixing transmit thread

* added more helper functions to simplify the transmit thread logic
* fixed transmit thread more....it still needs more work doee

TODO: continue fixing the transmit thread
transmit thread works & receive got broken

+ got the transmit thread working
+ added some helper functions to read and write data to and from the
  commport...they handle overlapped themselves, but you must provide
  commport handls
+ moved common things into new header files.....(protocolparams.h & typedefs.h)
+ removed the overlapped structure from within the commport object because
+ we're actually supposed to use a single overlapped structure for each
  operation
+ fixed up packetize data

- found a bug where letting the transmit thread time out MAX_MISS times
  such that it gives up sendiong, it will send the wrong packet the next
  time it sends stuff
- found bug; large packet sizes causes unpredictable behavior
- introduced bug where the receive thread is now kinda broken

TODO: fix above bugs
Merge branch 'eric' into dev