refactored the bulk of plc-config-tty into plc_config.py