Optional output validation and tests stubs generator.

Added tests stub generation and made output validation optional.