Added validators as functions.
Added docs for custom validators (closes #17).