Add a function based validator.
Simplify a little.
Merge pull request #12 from greboid/master

Add a function based validator.