Added Serial line encoding functions + events

https://github.com/arduino/Arduino/pull/2469
Weak implementation sounds usefull but takes 6 more bytes of flash/
function (12). Even more, if we would also pass the line states but the
user can read this with Serial.dtr() for example.

https://github.com/arduino/Arduino/pull/1179
Should we inline the Serial.dtr() functuions etc? But then we need to
move the line info to the header as well, also the definition.
These optional functions only take flash if they are used. Virtual isnt
used, because this would take more flash for no reason.
Syntax like this: https://www.pjrc.com/teensy/td_serial.html