Add in-container testing for server/socket read/write.

Removed NetTest.java, and did some refactoring of net.js.