Implemented auto reconnecting to serial port in case of failure.

+ Implemented signal handling for madoka.