got the serial2socket code working, and did a little bit of restructuring as well