Fix and improve the IPv6 regexp.
Add first unit tests.