Replace iprangeparse and subnetparse with a cleaner, unified implmentation