Add netmask_to_cidr function

Stemming from https://github.com/ansible/ansible/issues/8584 - Adding in the ability to convert a network mask to a CIDR value.