Add support for /32 and /31 length subnet masks

- Add checks that the numberOfAddresses is greater than 2, otherwise
treat the broadcast and network addresses as first and last addresses.
- numHosts returns correct size due to the first and last address
change for /31 and /32 networks.
- Add tests.
Could you please make it fit 80 column limit?