Closes #474: Move custom validations to lib

In reference to #474

 - Application of the patch