'net' module: tests and fixes

So far this updates #308 with a very basic test suite, and fixes IPv4 and/or IPv6 address detection.
About right, yeah. I would skip no. 2 for now at least, since no. 1 will fix the premature timeouts and we'll have to keep the current `.setTimeout` logic anyway for any sockets that have a faster timeout than the maximum. (Basically I'm not sure if it's worth adding a hardware binding and more between-socket coordination just to lower the hardware value too.)