Added a new constructor that allows a main class to be specified with no options and redirect stdout/stderr