Add validation function for netmasks
Add convenience function to convert netmask to subnet length