Support max and min on int fields

Use classes rather than functions to add richer validation options.