Abstract the comms port code and add a TCP connection method

Abstracted the communications port interface;
- Adapt the RS232 code to implemement the comms port interface.
- Add a TCPport implementation of the comms port interface.

Other changes to support this:
- Made the references to port issues not mention 'COM' specifically
  since it may also be a TCP port now.
- The gcode receive loop needs to flush Qt events so that the TCP
  socket can receive data into its buffer; this may also improve RS232
  comms.