Remove localhost:8000 magic value
Fix content-length bug
Use raw TCP sockets instead of muddling about in HTTP land