Moved function validators to #run on the chain (multiple functions will be merged).

Fields are required by default (removed #isRequired and replaced with #isOptional).

Folder restructuring, refactoring and other improvements.