Switched to gnu99 standard for better use of scope.

Showing extra gcc warnings.
Serial input is now checked for lines that are too long.

Other small fixes.
Removed unnecessary checking of baudrate values.

Made errors print to stderr.
Added some comments.