Add ipv6 support

Basic tests were also cleaned up.