Support for serial communication

I added support for serial communication, switchable using a parameter $useSerial. I also updated the field count to reflect the new message formats when parsing the serial message. Writing things back is not complete.

It throws some warnings when reading debug messages, but I think this is not my fault :-)