Pack IP addresses in Python and add some more debugging to the C++ code

This currently allows all of 127.0.0.1, 127.0.0, 127.0 and 127 as IP addresses in both C++ and Python due to what inet_aton lets through, do we want to make it more strict like olad's preferences IPv4 validator?