Validation rules and validate method for models

Just add the rules in the attributes inside the model using this pattern:
 <attribute> = { <valfunc> = {<args>}, ... }
Example: password = { not_empty = {}, len = {6,10} }