Add support for CIDR prefixes and hostnames in INTERNAL_IPS

CIDR prefixes are limited to Python 3.3+ as it depends on the ipaddress module.
Placing a CIDR prefix in the list when using an older Python will cause no problems.

Hostname lookups are supported on any Python.

I believe I've ensured that this shouldn't break any deployment, even if they have junk in their INTERNAL_IPS list.
Tests to excercise various kinds of bad entries that could be put in the INTERNAL_IPS list
A short note on hostnames and CIDR prefixes