Added validation for the ip and environment type

Value validation now occurs for ip address input and environment type
validation. IP address validation occurs through the use of a new
function validate_ip_addr while environment has validation in place
using comparators.