add optional filepath parameter to validation function + save & validation functions


* 'add optional filepath parameter to validation function' ...like save function, with error control
* 'save function directory check' based on filepath parameter, if not null
* 'require paths' for easy integration on other projects, works with 'php test.php'