do not allow invalid addresses to succeed in parse_ip

I don't think this is ready to merge. There may be other corner cases here. Needs more testing as well. It's here just to allow a quick look at my approach.