'net' module: tests and fixes

So far this updates #308 with a very basic test suite, and fixes IPv4 and/or IPv6 address detection.
This matches node documentation/source and lets the colony test suite pass with the POSIX adapter, as well as preventing a more cryptic error when code proceeds with null host. It's ultimately kinda pointless on the device due to lower-level trouble (https://github.com/tessel/firmware/issues/60), but seems to be the right thing here.