improved ip_in_range helper and using said helper when detecting maintenance mode IPs

allows for CIDR ranges ext to be used.