rework host stdout/stderr handling, main tests