cts default output 1 (it's active low)
Error detection, code cleanup ...

Added error detection outputs
Tested upto 921600 baud. Has framing error but output is correct.
Moved test code to separate file