Fix host validator to accept IPv6 and reject trailing slashes. Add tests