Fix networking to be properly framed; fix ASCII/Unicode problems with 2.7

This patch fixes networking to be properly line based (no half packets screwing things up.)
It also fixes some ascii/unicode problems I ran into when running with 2.7 on Linux.