Slightly more efficient output handling by line rather than individual characters
Added stderr capture
Fixed command window still showing