Added --timeout and close connection

Added a user configurable serial port timeout to the command line
utilities, and made them explicitly close the connection to the unit
immediately before they terminate.
Fixed several protocol errors

After more battling with the unit, fixed up several misunderstood
pieces of the protocol:

 * The heads field is now "known" and is checked

 * The mode field is now "known" and is used to distinguish between BOD
   and pressure mode, which also transmit their head data slightly
   differently

 * We now know that multiple heads are all listed on one line, and the
   parser has been updated accordingly

 * We now know the meaning of GSNS (get manual readings). Notes have
   been added, but no implementation yet
Tidied up emulator and logger interface class

After experimentation with the unit a couple of protocol
misunderstandings have been corrected (unit sends commands terminated
with CRLF, but responses only have CR), and all the manual CTS/RTS
nonsense has been removed (overly complicated and ultimately
unnecessary).

Also some minor patches to the virtual null-modem class (removed a hack
to do with monitoring CTS and only write to the opposite port if it's
actually opened).
Don't check for prompt after CLOC

The unit should shut down at this point and won't transmit anything else
unless we prompt it
Added XML serialization for bottles

And added a mandatory argument to the emulator to specify an XML file
with bottle definitions within it. Still need to add an XML export to
the dump and GUI apps to generate bottle definition files...