added new_ipv4_mask and unit tests for it

I also switched to inet_pton in preparation for supporting ipv6
addresses.  This speeds things up by a fair amount which leads me to
believe that inet_aton was a wrapper function for inet_pton anyway.