Significantly rework the network system

Very little user-visible changes other than .connect is gone (for now,
it might be resurrected) and server is now host. Lots of under-the-hood
changes though.

The underlying socket object is now composed instead of inherited, for
example. Eventually the entire network mixin will become a composed
object.
Fix enum due to botched sed
Make network completely composed.

This means that you no longer inherit from NetworkMixin. You can pass in
a NetworkBase subclass or you can leave it empty (and it will be created
for you).

the .connect method returns to client.py and it does what you expect.
Calling it is optional.
Make debug stuff optional
Add backwards compat shim for server
properly invalidate the socket on close
Fix a small bug in the pretty printer