Added ability to use a function to validate a model member

This change gives the developer more freedom by providing the option to perform value validation in his own callback function.