Added output STDOUT,STDERR and file methods
refactoring
Added test