add .validator() to bind a spec to a function
Merge pull request #5 from Floby/validator-constructor

add .validator() to bind a spec to a function