Added support for redirecting System.out and System.err to the host application.