netmask_to_cidr function added

To help convert between netmasks given in the facts to a CIDR
value, supply a jinja function to help us out.

This was discussed in https://github.com/ansible/ansible/issues/8584 but it doesn't look like anyone tried to get it in the tree.