Added baud rate search, minor improvements, code cleanup.