Added documentation and tests for how to define custom validators