adds ability to define an idle timeout

This adds the ability to define an idle timeout which in contrast to the current timeout considers only the time since the last output was produced by a process.

It also adds a special exception for timeout cases.