Rewrote the hosts plugin, added tests and ipv6 support