Removed extra comma after last item in several array literals.
Partial message encoding and decoding, with some unit testing in place.
Restored the use of Buffer.copy() in the test mockTransmit function.