'net' module: tests and fixes

So far this updates #308 with a very basic test suite, and fixes IPv4 and/or IPv6 address detection.
should we try to default to "127.0.0.1" if the CC3k can't actually handle it?