refactoring of validator + env + sapi + string handling. add unit tests #coderwall #pimfl